| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/predictors/predictors_ui.h" | 5 #include "chrome/browser/ui/webui/sync_file_system_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/predictors/predictors_handler.h" | |
| 9 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
| 10 #include "content/public/browser/web_contents.h" | |
| 11 #include "content/public/browser/web_ui.h" | 9 #include "content/public/browser/web_ui.h" |
| 12 #include "content/public/browser/web_ui_data_source.h" | 10 #include "content/public/browser/web_ui_data_source.h" |
| 13 #include "grit/browser_resources.h" | 11 #include "grit/sync_file_system_internals_resources.h" |
| 14 | 12 |
| 15 namespace { | 13 namespace { |
| 16 | 14 |
| 17 content::WebUIDataSource* CreatePredictorsUIHTMLSource() { | 15 content::WebUIDataSource* CreateSyncFileSystemInternalsHTMLSource() { |
| 18 content::WebUIDataSource* source = | 16 content::WebUIDataSource* source = |
| 19 content::WebUIDataSource::Create(chrome::kChromeUIPredictorsHost); | 17 content::WebUIDataSource::Create( |
| 20 source->AddResourcePath("predictors.js", IDR_PREDICTORS_JS); | 18 chrome::kChromeUISyncFileSystemInternalsHost); |
| 21 source->SetDefaultResource(IDR_PREDICTORS_HTML); | 19 source->SetDefaultResource(IDR_SYNC_FILE_SYSTEM_INTERNALS_MAIN_HTML); |
| 22 return source; | 20 return source; |
| 23 } | 21 } |
| 24 | 22 |
| 25 } // namespace | 23 } // namespace |
| 26 | 24 |
| 27 PredictorsUI::PredictorsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 25 SyncFileSystemInternalsUI::SyncFileSystemInternalsUI(content::WebUI* web_ui) |
| 26 : WebUIController(web_ui) { |
| 28 Profile* profile = Profile::FromWebUI(web_ui); | 27 Profile* profile = Profile::FromWebUI(web_ui); |
| 29 web_ui->AddMessageHandler(new PredictorsHandler(profile)); | 28 content::WebUIDataSource::Add(profile, |
| 30 content::WebUIDataSource::Add(profile, CreatePredictorsUIHTMLSource()); | 29 CreateSyncFileSystemInternalsHTMLSource()); |
| 31 } | 30 } |
| 31 |
| 32 SyncFileSystemInternalsUI::~SyncFileSystemInternalsUI() {} |
| OLD | NEW |