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/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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/ref_counted_memory.h" | 16 #include "base/memory/ref_counted_memory.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/string_piece.h" | 19 #include "base/string_piece.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "chrome/browser/chromeos/cros/cros_library.h" | 23 #include "chrome/browser/chromeos/cros/cros_library.h" |
24 #include "chrome/browser/chromeos/cros/network_library.h" | 24 #include "chrome/browser/chromeos/cros/network_library.h" |
25 #include "chrome/browser/chromeos/mobile/mobile_activator.h" | 25 #include "chrome/browser/chromeos/mobile/mobile_activator.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/ui/browser_list.h" | 27 #include "chrome/browser/ui/browser_list.h" |
28 #include "chrome/browser/ui/webui/web_ui_util.h" | 28 #include "chrome/browser/ui/webui/web_ui_util.h" |
29 #include "chrome/common/jstemplate_builder.h" | |
30 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
31 #include "chrome/common/render_messages.h" | 30 #include "chrome/common/render_messages.h" |
32 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
33 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
34 #include "content/public/browser/render_view_host_observer.h" | 33 #include "content/public/browser/render_view_host_observer.h" |
35 #include "content/public/browser/url_data_source.h" | 34 #include "content/public/browser/url_data_source.h" |
36 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
37 #include "content/public/browser/web_ui.h" | 36 #include "content/public/browser/web_ui.h" |
38 #include "content/public/browser/web_ui_message_handler.h" | 37 #include "content/public/browser/web_ui_message_handler.h" |
39 #include "googleurl/src/gurl.h" | 38 #include "googleurl/src/gurl.h" |
40 #include "grit/browser_resources.h" | 39 #include "grit/browser_resources.h" |
41 #include "grit/chromium_strings.h" | 40 #include "grit/chromium_strings.h" |
42 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
43 #include "grit/locale_settings.h" | 42 #include "grit/locale_settings.h" |
44 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
45 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
| 45 #include "ui/webui/jstemplate_builder.h" |
46 | 46 |
47 using chromeos::CellularNetwork; | 47 using chromeos::CellularNetwork; |
48 using chromeos::CrosLibrary; | 48 using chromeos::CrosLibrary; |
49 using chromeos::MobileActivator; | 49 using chromeos::MobileActivator; |
50 using content::BrowserThread; | 50 using content::BrowserThread; |
51 using content::RenderViewHost; | 51 using content::RenderViewHost; |
52 using content::WebContents; | 52 using content::WebContents; |
53 using content::WebUIMessageHandler; | 53 using content::WebUIMessageHandler; |
54 | 54 |
55 namespace { | 55 namespace { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 // Set up the chrome://mobilesetup/ source. | 345 // Set up the chrome://mobilesetup/ source. |
346 Profile* profile = Profile::FromWebUI(web_ui); | 346 Profile* profile = Profile::FromWebUI(web_ui); |
347 ChromeURLDataManager::AddDataSource(profile, html_source); | 347 ChromeURLDataManager::AddDataSource(profile, html_source); |
348 } | 348 } |
349 | 349 |
350 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { | 350 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { |
351 // Destroyed by the corresponding RenderViewHost | 351 // Destroyed by the corresponding RenderViewHost |
352 new PortalFrameLoadObserver(AsWeakPtr(), host); | 352 new PortalFrameLoadObserver(AsWeakPtr(), host); |
353 } | 353 } |
OLD | NEW |