OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 8 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
9 #include "content/public/browser/web_ui.h" | 9 #include "content/public/browser/web_ui.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 GetAdditionalParameters(dict); | 67 GetAdditionalParameters(dict); |
68 } | 68 } |
69 | 69 |
70 void BaseScreenHandler::GetAdditionalParameters(base::DictionaryValue* dict) { | 70 void BaseScreenHandler::GetAdditionalParameters(base::DictionaryValue* dict) { |
71 } | 71 } |
72 | 72 |
73 void BaseScreenHandler::CallJS(const std::string& method) { | 73 void BaseScreenHandler::CallJS(const std::string& method) { |
74 web_ui()->CallJavascriptFunction(method); | 74 web_ui()->CallJavascriptFunction(method); |
75 } | 75 } |
76 | 76 |
77 void BaseScreenHandler::CallJS(const std::string& method, | |
78 const base::Value& arg1) { | |
79 web_ui()->CallJavascriptFunction(method, arg1); | |
80 } | |
81 | |
82 void BaseScreenHandler::CallJS(const std::string& method, | |
83 const base::Value& arg1, | |
84 const base::Value& arg2) { | |
85 web_ui()->CallJavascriptFunction(method, arg1, arg2); | |
86 } | |
87 | |
88 void BaseScreenHandler::CallJS(const std::string& method, | |
89 const base::Value& arg1, | |
90 const base::Value& arg2, | |
91 const base::Value& arg3) { | |
92 web_ui()->CallJavascriptFunction(method, arg1, arg2, arg3); | |
93 } | |
94 | |
95 void BaseScreenHandler::CallJS(const std::string& method, | |
96 const base::Value& arg1, | |
97 const base::Value& arg2, | |
98 const base::Value& arg3, | |
99 const base::Value& arg4) { | |
100 web_ui()->CallJavascriptFunction(method, arg1, arg2, arg3, arg4); | |
101 } | |
102 | |
103 void BaseScreenHandler::ShowScreen(const char* screen_name, | 77 void BaseScreenHandler::ShowScreen(const char* screen_name, |
104 const base::DictionaryValue* data) { | 78 const base::DictionaryValue* data) { |
105 if (!web_ui()) | 79 if (!web_ui()) |
106 return; | 80 return; |
107 DictionaryValue screen_params; | 81 DictionaryValue screen_params; |
108 screen_params.SetString("id", screen_name); | 82 screen_params.SetString("id", screen_name); |
109 if (data) | 83 if (data) |
110 screen_params.SetWithoutPathExpansion("data", data->DeepCopy()); | 84 screen_params.SetWithoutPathExpansion("data", data->DeepCopy()); |
111 web_ui()->CallJavascriptFunction("cr.ui.Oobe.showScreen", screen_params); | 85 web_ui()->CallJavascriptFunction("cr.ui.Oobe.showScreen", screen_params); |
112 } | 86 } |
113 | 87 |
114 gfx::NativeWindow BaseScreenHandler::GetNativeWindow() { | 88 gfx::NativeWindow BaseScreenHandler::GetNativeWindow() { |
115 return BaseLoginDisplayHost::default_host()->GetNativeWindow(); | 89 return BaseLoginDisplayHost::default_host()->GetNativeWindow(); |
116 } | 90 } |
117 | 91 |
118 } // namespace chromeos | 92 } // namespace chromeos |
OLD | NEW |