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 #ifndef CHROME_BROWSER_UI_WEBUI_TRACKING_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PROFILER_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_TRACKING_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PROFILER_UI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/ui/webui/chrome_web_ui.h" | 12 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
13 | 13 |
14 // The C++ back-end for the chrome://tracking2 webui page. | 14 // The C++ back-end for the chrome://profiler webui page. |
15 class TrackingUI : public ChromeWebUI { | 15 class ProfilerUI : public ChromeWebUI { |
16 public: | 16 public: |
17 explicit TrackingUI(TabContents* contents); | 17 explicit ProfilerUI(TabContents* contents); |
18 virtual ~TrackingUI(); | 18 virtual ~ProfilerUI(); |
19 | 19 |
20 // Get the tracking data from TrackingSynchronizer. | 20 // Get the tracking data from TrackingSynchronizer. |
21 void GetData(); | 21 void GetData(); |
22 | 22 |
23 // Send the data to the renderer. | 23 // Send the data to the renderer. |
24 void ReceivedData(base::Value* value); | 24 void ReceivedData(base::Value* value); |
25 | 25 |
26 private: | 26 private: |
27 // Used to get |weak_ptr_| to self on the UI thread. | 27 // Used to get |weak_ptr_| to self on the UI thread. |
28 scoped_ptr<base::WeakPtrFactory<TrackingUI> > ui_weak_ptr_factory_; | 28 scoped_ptr<base::WeakPtrFactory<ProfilerUI> > ui_weak_ptr_factory_; |
29 base::WeakPtr<TrackingUI> ui_weak_ptr_; | 29 base::WeakPtr<ProfilerUI> ui_weak_ptr_; |
30 | 30 |
31 DISALLOW_COPY_AND_ASSIGN(TrackingUI); | 31 DISALLOW_COPY_AND_ASSIGN(ProfilerUI); |
32 }; | 32 }; |
33 | 33 |
34 #endif // CHROME_BROWSER_UI_WEBUI_TRACKING_UI_H_ | 34 #endif // CHROME_BROWSER_UI_WEBUI_PROFILER_UI_H_ |
OLD | NEW |