OLD | NEW |
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/mobile_setup_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/chromeos/cros/cros_library.h" | 25 #include "chrome/browser/chromeos/cros/cros_library.h" |
26 #include "chrome/browser/chromeos/cros/network_library.h" | 26 #include "chrome/browser/chromeos/cros/network_library.h" |
27 #include "chrome/browser/prefs/pref_service.h" | 27 #include "chrome/browser/prefs/pref_service.h" |
28 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
29 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
30 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 30 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
31 #include "chrome/common/jstemplate_builder.h" | 31 #include "chrome/common/jstemplate_builder.h" |
32 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
33 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
35 #include "content/browser/renderer_host/render_view_host_observer.h" | |
36 #include "content/browser/tab_contents/tab_contents.h" | 35 #include "content/browser/tab_contents/tab_contents.h" |
37 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/render_view_host_observer.h" |
38 #include "googleurl/src/gurl.h" | 38 #include "googleurl/src/gurl.h" |
39 #include "grit/browser_resources.h" | 39 #include "grit/browser_resources.h" |
40 #include "grit/chromium_strings.h" | 40 #include "grit/chromium_strings.h" |
41 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
42 #include "grit/locale_settings.h" | 42 #include "grit/locale_settings.h" |
43 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
44 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
45 | 45 |
46 using content::BrowserThread; | 46 using content::BrowserThread; |
47 | 47 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 chromeos::CellularNetwork* GetCellularNetwork( | 119 chromeos::CellularNetwork* GetCellularNetwork( |
120 const std::string& service_path) { | 120 const std::string& service_path) { |
121 return chromeos::CrosLibrary::Get()-> | 121 return chromeos::CrosLibrary::Get()-> |
122 GetNetworkLibrary()->FindCellularNetworkByPath(service_path); | 122 GetNetworkLibrary()->FindCellularNetworkByPath(service_path); |
123 } | 123 } |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 // Observes IPC messages from the rederer and notifies JS if frame loading error | 127 // Observes IPC messages from the rederer and notifies JS if frame loading error |
128 // appears. | 128 // appears. |
129 class PortalFrameLoadObserver : public RenderViewHostObserver { | 129 class PortalFrameLoadObserver : public content::RenderViewHostObserver { |
130 public: | 130 public: |
131 PortalFrameLoadObserver(RenderViewHost* host, WebUI* webui) | 131 PortalFrameLoadObserver(RenderViewHost* host, WebUI* webui) |
132 : RenderViewHostObserver(host), webui_(webui) { | 132 : content::RenderViewHostObserver(host), webui_(webui) { |
133 DCHECK(webui_); | 133 DCHECK(webui_); |
134 Send(new ChromeViewMsg_StartFrameSniffer(routing_id(), | 134 Send(new ChromeViewMsg_StartFrameSniffer(routing_id(), |
135 UTF8ToUTF16("paymentForm"))); | 135 UTF8ToUTF16("paymentForm"))); |
136 } | 136 } |
137 | 137 |
138 virtual ~PortalFrameLoadObserver() {} | 138 virtual ~PortalFrameLoadObserver() {} |
139 | 139 |
140 // IPC::Channel::Listener implementation. | 140 // IPC::Channel::Listener implementation. |
141 virtual bool OnMessageReceived(const IPC::Message& message) { | 141 virtual bool OnMessageReceived(const IPC::Message& message) { |
142 bool handled = true; | 142 bool handled = true; |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 // Set up the chrome://mobilesetup/ source. | 1372 // Set up the chrome://mobilesetup/ source. |
1373 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 1373 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
1374 profile->GetChromeURLDataManager()->AddDataSource(html_source); | 1374 profile->GetChromeURLDataManager()->AddDataSource(html_source); |
1375 } | 1375 } |
1376 | 1376 |
1377 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { | 1377 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { |
1378 ChromeWebUI::RenderViewCreated(host); | 1378 ChromeWebUI::RenderViewCreated(host); |
1379 // Destroyed by the corresponding RenderViewHost. | 1379 // Destroyed by the corresponding RenderViewHost. |
1380 new PortalFrameLoadObserver(host, tab_contents()->web_ui()); | 1380 new PortalFrameLoadObserver(host, tab_contents()->web_ui()); |
1381 } | 1381 } |
OLD | NEW |