Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc

Issue 8113018: [web-ui] Migrate RegisterMessageCallback usage to base::bind(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/network_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h"
6 6
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
7 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
8 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
9 #include "base/values.h" 11 #include "base/values.h"
10 #include "content/browser/webui/web_ui.h" 12 #include "content/browser/webui/web_ui.h"
11 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/cros/cros_library.h" 14 #include "chrome/browser/chromeos/cros/cros_library.h"
13 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 15 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
14 #include "chrome/browser/chromeos/input_method/input_method_util.h" 16 #include "chrome/browser/chromeos/input_method/input_method_util.h"
15 #include "chrome/browser/chromeos/login/language_switch_menu.h" 17 #include "chrome/browser/chromeos/login/language_switch_menu.h"
16 #include "chrome/browser/chromeos/status/input_method_menu.h" 18 #include "chrome/browser/chromeos/status/input_method_menu.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (show_on_init_) { 133 if (show_on_init_) {
132 show_on_init_ = false; 134 show_on_init_ = false;
133 Show(); 135 Show();
134 } 136 }
135 } 137 }
136 138
137 // NetworkScreenHandler, WebUIMessageHandler implementation: ------------------- 139 // NetworkScreenHandler, WebUIMessageHandler implementation: -------------------
138 140
139 void NetworkScreenHandler::RegisterMessages() { 141 void NetworkScreenHandler::RegisterMessages() {
140 web_ui_->RegisterMessageCallback(kJsApiNetworkOnExit, 142 web_ui_->RegisterMessageCallback(kJsApiNetworkOnExit,
141 NewCallback(this, &NetworkScreenHandler::HandleOnExit)); 143 base::Bind(&NetworkScreenHandler::HandleOnExit,base::Unretained(this)));
142 web_ui_->RegisterMessageCallback(kJsApiNetworkOnLanguageChanged, 144 web_ui_->RegisterMessageCallback(kJsApiNetworkOnLanguageChanged,
143 NewCallback(this, &NetworkScreenHandler::HandleOnLanguageChanged)); 145 base::Bind(&NetworkScreenHandler::HandleOnLanguageChanged,
146 base::Unretained(this)));
144 web_ui_->RegisterMessageCallback(kJsApiNetworkOnInputMethodChanged, 147 web_ui_->RegisterMessageCallback(kJsApiNetworkOnInputMethodChanged,
145 NewCallback(this, &NetworkScreenHandler::HandleOnInputMethodChanged)); 148 base::Bind(&NetworkScreenHandler::HandleOnInputMethodChanged,
149 base::Unretained(this)));
146 } 150 }
147 151
148 // NetworkScreenHandler, private: ---------------------------------------------- 152 // NetworkScreenHandler, private: ----------------------------------------------
149 153
150 void NetworkScreenHandler::HandleOnExit(const ListValue* args) { 154 void NetworkScreenHandler::HandleOnExit(const ListValue* args) {
151 ClearErrors(); 155 ClearErrors();
152 screen_->OnContinuePressed(); 156 screen_->OnContinuePressed();
153 } 157 }
154 158
155 void NetworkScreenHandler::HandleOnLanguageChanged(const ListValue* args) { 159 void NetworkScreenHandler::HandleOnLanguageChanged(const ListValue* args) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 input_method->SetString( 225 input_method->SetString(
222 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i))); 226 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i)));
223 input_method->SetBoolean("selected", 227 input_method->SetBoolean("selected",
224 input_methods->at(i).id() == current_input_method_id); 228 input_methods->at(i).id() == current_input_method_id);
225 input_methods_list->Append(input_method); 229 input_methods_list->Append(input_method);
226 } 230 }
227 return input_methods_list; 231 return input_methods_list;
228 } 232 }
229 233
230 } // namespace chromeos 234 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698