| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tracking_ui.h" | 5 #include "chrome/browser/ui/webui/tracking_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/tracked_objects.h" | 10 #include "base/tracked_objects.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 12 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 14 #include "content/browser/tab_contents/tab_contents.h" | 14 #include "content/browser/tab_contents/tab_contents.h" |
| 15 #include "content/browser/trace_controller.h" | 15 #include "content/browser/trace_controller.h" |
| 16 #include "grit/browser_resources.h" | 16 #include "grit/browser_resources.h" |
| 17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 | 18 |
| 19 using content::BrowserThread; |
| 20 |
| 19 namespace { | 21 namespace { |
| 20 | 22 |
| 21 ChromeWebUIDataSource* CreateTrackingHTMLSource() { | 23 ChromeWebUIDataSource* CreateTrackingHTMLSource() { |
| 22 // TODO(eroman): Use kChromeUITrackingHost instead of kChromeUITrackingHost2 | 24 // TODO(eroman): Use kChromeUITrackingHost instead of kChromeUITrackingHost2 |
| 23 // once migration to webui is complete. | 25 // once migration to webui is complete. |
| 24 ChromeWebUIDataSource* source = | 26 ChromeWebUIDataSource* source = |
| 25 new ChromeWebUIDataSource(chrome::kChromeUITrackingHost2); | 27 new ChromeWebUIDataSource(chrome::kChromeUITrackingHost2); |
| 26 | 28 |
| 27 source->set_json_path("strings.js"); | 29 source->set_json_path("strings.js"); |
| 28 source->add_resource_path("tracking.js", IDR_TRACKING_JS); | 30 source->add_resource_path("tracking.js", IDR_TRACKING_JS); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 81 |
| 80 } // namespace | 82 } // namespace |
| 81 | 83 |
| 82 TrackingUI::TrackingUI(TabContents* contents) : ChromeWebUI(contents) { | 84 TrackingUI::TrackingUI(TabContents* contents) : ChromeWebUI(contents) { |
| 83 AddMessageHandler((new TrackingMessageHandler())->Attach(this)); | 85 AddMessageHandler((new TrackingMessageHandler())->Attach(this)); |
| 84 | 86 |
| 85 // Set up the chrome://tracking2/ source. | 87 // Set up the chrome://tracking2/ source. |
| 86 Profile::FromBrowserContext(contents->browser_context())-> | 88 Profile::FromBrowserContext(contents->browser_context())-> |
| 87 GetChromeURLDataManager()->AddDataSource(CreateTrackingHTMLSource()); | 89 GetChromeURLDataManager()->AddDataSource(CreateTrackingHTMLSource()); |
| 88 } | 90 } |
| OLD | NEW |