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

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

Issue 11740018: Cleanup: Remove more unneeded browser_thread.h includes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 7 years, 11 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) 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/choose_mobile_network_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/string_piece.h" 14 #include "base/string_piece.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
17 #include "chrome/browser/chromeos/cros/network_library.h" 17 #include "chrome/browser/chromeos/cros/network_library.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 19 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
20 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 20 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
21 #include "chrome/common/jstemplate_builder.h" 21 #include "chrome/common/jstemplate_builder.h"
22 #include "chrome/common/url_constants.h" 22 #include "chrome/common/url_constants.h"
23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/web_contents.h" 23 #include "content/public/browser/web_contents.h"
25 #include "content/public/browser/web_ui.h" 24 #include "content/public/browser/web_ui.h"
26 #include "content/public/browser/web_ui_message_handler.h" 25 #include "content/public/browser/web_ui_message_handler.h"
27 #include "grit/browser_resources.h" 26 #include "grit/browser_resources.h"
28 #include "grit/generated_resources.h" 27 #include "grit/generated_resources.h"
29 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
30 #include "ui/base/resource/resource_bundle.h" 29 #include "ui/base/resource/resource_bundle.h"
31 30
32 using content::WebContents; 31 using content::WebContents;
33 using content::WebUIMessageHandler; 32 using content::WebUIMessageHandler;
34 33
35 namespace chromeos { 34 namespace chromeos {
36 35
37 namespace { 36 namespace {
38 37
39 // JS API callbacks names. 38 // JS API callbacks names.
40 const char kJsApiCancel[] = "cancel"; 39 const char kJsApiCancel[] = "cancel";
41 const char kJsApiConnect[] = "connect"; 40 const char kJsApiConnect[] = "connect";
42 const char kJsApiPageReady[] = "pageReady"; 41 const char kJsApiPageReady[] = "pageReady";
43 42
44 // Page JS API function names. 43 // Page JS API function names.
45 const char kJsApiShowNetworks[] = "mobile.ChooseNetwork.showNetworks"; 44 const char kJsApiShowNetworks[] = "mobile.ChooseNetwork.showNetworks";
46 45
47 // Network properties. 46 // Network properties.
48 const char kNetworkIdProperty[] = "networkId"; 47 const char kNetworkIdProperty[] = "networkId";
49 const char kOperatorNameProperty[] = "operatorName"; 48 const char kOperatorNameProperty[] = "operatorName";
50 const char kStatusProperty[] = "status"; 49 const char kStatusProperty[] = "status";
51 const char kTechnologyProperty[] = "technology"; 50 const char kTechnologyProperty[] = "technology";
52 51
53 ChromeWebUIDataSource *CreateChooseMobileNetworkUIHTMLSource() { 52 ChromeWebUIDataSource* CreateChooseMobileNetworkUIHTMLSource() {
54 ChromeWebUIDataSource *source = 53 ChromeWebUIDataSource* source =
55 new ChromeWebUIDataSource(chrome::kChromeUIChooseMobileNetworkHost); 54 new ChromeWebUIDataSource(chrome::kChromeUIChooseMobileNetworkHost);
56 55
57 source->AddLocalizedString("chooseNetworkTitle", 56 source->AddLocalizedString("chooseNetworkTitle",
58 IDS_NETWORK_CHOOSE_MOBILE_NETWORK); 57 IDS_NETWORK_CHOOSE_MOBILE_NETWORK);
59 source->AddLocalizedString("scanningMsgLine1", 58 source->AddLocalizedString("scanningMsgLine1",
60 IDS_NETWORK_SCANNING_FOR_MOBILE_NETWORKS); 59 IDS_NETWORK_SCANNING_FOR_MOBILE_NETWORKS);
61 source->AddLocalizedString("scanningMsgLine2", 60 source->AddLocalizedString("scanningMsgLine2",
62 IDS_NETWORK_SCANNING_THIS_MAY_TAKE_A_MINUTE); 61 IDS_NETWORK_SCANNING_THIS_MAY_TAKE_A_MINUTE);
63 source->AddLocalizedString("noMobileNetworks", 62 source->AddLocalizedString("noMobileNetworks",
64 IDS_NETWORK_NO_MOBILE_NETWORKS); 63 IDS_NETWORK_NO_MOBILE_NETWORKS);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 : WebUIController(web_ui) { 214 : WebUIController(web_ui) {
216 ChooseMobileNetworkHandler* handler = new ChooseMobileNetworkHandler(); 215 ChooseMobileNetworkHandler* handler = new ChooseMobileNetworkHandler();
217 web_ui->AddMessageHandler(handler); 216 web_ui->AddMessageHandler(handler);
218 // Set up the "chrome://choose-mobile-network" source. 217 // Set up the "chrome://choose-mobile-network" source.
219 Profile* profile = Profile::FromWebUI(web_ui); 218 Profile* profile = Profile::FromWebUI(web_ui);
220 ChromeURLDataManager::AddDataSource(profile, 219 ChromeURLDataManager::AddDataSource(profile,
221 CreateChooseMobileNetworkUIHTMLSource()); 220 CreateChooseMobileNetworkUIHTMLSource());
222 } 221 }
223 222
224 } // namespace chromeos 223 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/login/login_prompt_browsertest.cc ('k') | chrome/browser/ui/webui/chromeos/diagnostics/diagnostics_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698