OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/local_state/local_state_ui.h" | 5 #include "chrome/browser/ui/webui/local_state/local_state_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/prefs/pref_service.h" | |
12 #include "build/build_config.h" | 11 #include "build/build_config.h" |
13 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 15 #include "components/prefs/pref_service.h" |
16 #include "content/public/browser/web_ui.h" | 16 #include "content/public/browser/web_ui.h" |
17 #include "content/public/browser/web_ui_controller.h" | 17 #include "content/public/browser/web_ui_controller.h" |
18 #include "content/public/browser/web_ui_data_source.h" | 18 #include "content/public/browser/web_ui_data_source.h" |
19 #include "content/public/browser/web_ui_message_handler.h" | 19 #include "content/public/browser/web_ui_message_handler.h" |
20 #include "grit/browser_resources.h" | 20 #include "grit/browser_resources.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // UI Handler for chrome://local-state. Displays the Local State file as JSON. | 24 // UI Handler for chrome://local-state. Displays the Local State file as JSON. |
25 class LocalStateUIHandler : public content::WebUIMessageHandler { | 25 class LocalStateUIHandler : public content::WebUIMessageHandler { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 html_source->SetDefaultResource(IDR_LOCAL_STATE_HTML); | 76 html_source->SetDefaultResource(IDR_LOCAL_STATE_HTML); |
77 html_source->AddResourcePath("local_state.js", IDR_LOCAL_STATE_JS); | 77 html_source->AddResourcePath("local_state.js", IDR_LOCAL_STATE_JS); |
78 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); | 78 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); |
79 | 79 |
80 // AddMessageHandler takes ownership of LocalStateUIHandler. | 80 // AddMessageHandler takes ownership of LocalStateUIHandler. |
81 web_ui->AddMessageHandler(new LocalStateUIHandler); | 81 web_ui->AddMessageHandler(new LocalStateUIHandler); |
82 } | 82 } |
83 | 83 |
84 LocalStateUI::~LocalStateUI() { | 84 LocalStateUI::~LocalStateUI() { |
85 } | 85 } |
OLD | NEW |