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/sim_unlock_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/string_piece.h" | 15 #include "base/string_piece.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
18 #include "chrome/browser/chromeos/cros/network_library.h" | 18 #include "chrome/browser/chromeos/cros/network_library.h" |
19 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 19 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/webui/web_ui_util.h" | 21 #include "chrome/browser/ui/webui/web_ui_util.h" |
22 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
23 #include "chrome/common/jstemplate_builder.h" | |
24 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
25 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
27 #include "content/public/browser/url_data_source.h" | 26 #include "content/public/browser/url_data_source.h" |
28 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
29 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
30 #include "content/public/browser/web_ui_message_handler.h" | 29 #include "content/public/browser/web_ui_message_handler.h" |
31 #include "grit/browser_resources.h" | 30 #include "grit/browser_resources.h" |
32 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
34 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/webui/jstemplate_builder.h" |
35 | 35 |
36 using content::BrowserThread; | 36 using content::BrowserThread; |
37 using content::WebContents; | 37 using content::WebContents; |
38 using content::WebUIMessageHandler; | 38 using content::WebUIMessageHandler; |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 // JS API callbacks names. | 42 // JS API callbacks names. |
43 const char kJsApiCancel[] = "cancel"; | 43 const char kJsApiCancel[] = "cancel"; |
44 const char kJsApiChangePinCode[] = "changePinCode"; | 44 const char kJsApiChangePinCode[] = "changePinCode"; |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 SimUnlockHandler* handler = new SimUnlockHandler(); | 678 SimUnlockHandler* handler = new SimUnlockHandler(); |
679 web_ui->AddMessageHandler(handler); | 679 web_ui->AddMessageHandler(handler); |
680 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); | 680 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); |
681 | 681 |
682 // Set up the chrome://sim-unlock/ source. | 682 // Set up the chrome://sim-unlock/ source. |
683 Profile* profile = Profile::FromWebUI(web_ui); | 683 Profile* profile = Profile::FromWebUI(web_ui); |
684 ChromeURLDataManager::AddDataSource(profile, html_source); | 684 ChromeURLDataManager::AddDataSource(profile, html_source); |
685 } | 685 } |
686 | 686 |
687 } // namespace chromeos | 687 } // namespace chromeos |
OLD | NEW |