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/sync_internals_ui.h" | 5 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/webui/sync_internals_message_handler.h" | 8 #include "chrome/browser/ui/webui/sync_internals_message_handler.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "content/public/browser/web_ui.h" | 10 #include "content/public/browser/web_ui.h" |
11 #include "content/public/browser/web_ui_data_source.h" | 11 #include "content/public/browser/web_ui_data_source.h" |
12 #include "extensions/common/extension_messages.h" | 12 #include "extensions/common/extension_messages.h" |
13 #include "grit/sync_internals_resources.h" | 13 #include "grit/sync_internals_resources.h" |
14 #include "ui/base/resource/resource_bundle.h" | |
15 | 14 |
16 namespace { | 15 namespace { |
17 | 16 |
18 content::WebUIDataSource* CreateSyncInternalsHTMLSource() { | 17 content::WebUIDataSource* CreateSyncInternalsHTMLSource() { |
19 content::WebUIDataSource* source = | 18 content::WebUIDataSource* source = |
20 content::WebUIDataSource::Create(chrome::kChromeUISyncInternalsHost); | 19 content::WebUIDataSource::Create(chrome::kChromeUISyncInternalsHost); |
21 | 20 |
22 source->SetUseJsonJSFormatV2(); | 21 source->SetUseJsonJSFormatV2(); |
23 source->SetJsonPath("strings.js"); | 22 source->SetJsonPath("strings.js"); |
24 source->AddResourcePath("sync_index.js", IDR_SYNC_INTERNALS_INDEX_JS); | 23 source->AddResourcePath("sync_index.js", IDR_SYNC_INTERNALS_INDEX_JS); |
(...skipping 18 matching lines...) Expand all Loading... |
43 SyncInternalsUI::SyncInternalsUI(content::WebUI* web_ui) | 42 SyncInternalsUI::SyncInternalsUI(content::WebUI* web_ui) |
44 : WebUIController(web_ui) { | 43 : WebUIController(web_ui) { |
45 Profile* profile = Profile::FromWebUI(web_ui); | 44 Profile* profile = Profile::FromWebUI(web_ui); |
46 content::WebUIDataSource::Add(profile, CreateSyncInternalsHTMLSource()); | 45 content::WebUIDataSource::Add(profile, CreateSyncInternalsHTMLSource()); |
47 | 46 |
48 web_ui->AddMessageHandler(new SyncInternalsMessageHandler); | 47 web_ui->AddMessageHandler(new SyncInternalsMessageHandler); |
49 } | 48 } |
50 | 49 |
51 SyncInternalsUI::~SyncInternalsUI() {} | 50 SyncInternalsUI::~SyncInternalsUI() {} |
52 | 51 |
OLD | NEW |