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_NTP_NEW_TAB_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/timer.h" | 12 #include "base/timer.h" |
13 #include "chrome/browser/sessions/tab_restore_service.h" | 13 #include "chrome/browser/sessions/tab_restore_service.h" |
14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
15 #include "content/browser/webui/web_ui.h" | 15 #include "content/browser/webui/web_ui.h" |
16 #include "content/common/notification_observer.h" | 16 #include "content/common/notification_observer.h" |
17 #include "content/common/notification_registrar.h" | 17 #include "content/common/notification_registrar.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 class MessageLoop; | 20 class MessageLoop; |
21 class PrefService; | 21 class PrefService; |
22 class Profile; | 22 class Profile; |
23 | 23 |
24 // The TabContents used for the New Tab page. | 24 // The TabContents used for the New Tab page. |
25 class NewTabUI : public WebUI, | 25 class NewTabUI : public WebUI, |
26 public NotificationObserver { | 26 public NotificationObserver { |
27 public: | 27 public: |
28 explicit NewTabUI(TabContents* manager); | 28 explicit NewTabUI(TabContents* manager); |
29 ~NewTabUI(); | 29 virtual ~NewTabUI(); |
30 | 30 |
31 // Override WebUI methods so we can hook up the paint timer to the render | 31 // Override WebUI methods so we can hook up the paint timer to the render |
32 // view host. | 32 // view host. |
33 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 33 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
34 virtual void RenderViewReused(RenderViewHost* render_view_host); | 34 virtual void RenderViewReused(RenderViewHost* render_view_host); |
35 | 35 |
36 static void RegisterUserPrefs(PrefService* prefs); | 36 static void RegisterUserPrefs(PrefService* prefs); |
37 static void MigrateUserPrefs(PrefService* prefs, int old_pref_version, | 37 static void MigrateUserPrefs(PrefService* prefs, int old_pref_version, |
38 int new_pref_version); | 38 int new_pref_version); |
39 | 39 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 base::TimeTicks last_paint_; | 111 base::TimeTicks last_paint_; |
112 // Scoping so we can be sure our timeouts don't outlive us. | 112 // Scoping so we can be sure our timeouts don't outlive us. |
113 base::OneShotTimer<NewTabUI> timer_; | 113 base::OneShotTimer<NewTabUI> timer_; |
114 // The preference version. This used for migrating prefs of the NTP. | 114 // The preference version. This used for migrating prefs of the NTP. |
115 static const int current_pref_version_ = 3; | 115 static const int current_pref_version_ = 3; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 117 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
118 }; | 118 }; |
119 | 119 |
120 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 120 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
OLD | NEW |