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 #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 | 7 |
8 #include <map> | 8 #include <map> |
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/prefs/public/pref_change_registrar.h" | 12 #include "base/prefs/public/pref_change_registrar.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 #include "chrome/browser/sessions/tab_restore_service.h" | 15 #include "chrome/browser/sessions/tab_restore_service.h" |
16 #include "content/public/browser/url_data_source.h" | |
17 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/url_data_source.h" |
19 #include "content/public/browser/web_ui_controller.h" | 19 #include "content/public/browser/web_ui_controller.h" |
20 | 20 |
21 class GURL; | 21 class GURL; |
22 class PrefServiceSyncable; | 22 class PrefRegistrySyncable; |
23 class Profile; | 23 class Profile; |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class DictionaryValue; | 26 class DictionaryValue; |
27 } | 27 } |
28 | 28 |
29 // The WebContents used for the New Tab page. | 29 // The WebContents used for the New Tab page. |
30 class NewTabUI : public content::WebUIController, | 30 class NewTabUI : public content::WebUIController, |
31 public content::NotificationObserver { | 31 public content::NotificationObserver { |
32 public: | 32 public: |
33 explicit NewTabUI(content::WebUI* web_ui); | 33 explicit NewTabUI(content::WebUI* web_ui); |
34 virtual ~NewTabUI(); | 34 virtual ~NewTabUI(); |
35 | 35 |
36 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 36 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
37 | 37 |
38 // Returns whether or not to show apps pages. | 38 // Returns whether or not to show apps pages. |
39 static bool ShouldShowApps(); | 39 static bool ShouldShowApps(); |
40 | 40 |
41 // Returns whether or not "Discovery" in the NTP is Enabled. | 41 // Returns whether or not "Discovery" in the NTP is Enabled. |
42 static bool IsDiscoveryInNTPEnabled(); | 42 static bool IsDiscoveryInNTPEnabled(); |
43 | 43 |
44 // Adds "url", "title", and "direction" keys on incoming dictionary, setting | 44 // Adds "url", "title", and "direction" keys on incoming dictionary, setting |
45 // title as the url as a fallback on empty title. | 45 // title as the url as a fallback on empty title. |
46 static void SetUrlTitleAndDirection(base::DictionaryValue* dictionary, | 46 static void SetUrlTitleAndDirection(base::DictionaryValue* dictionary, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 // If the sync promo NTP bubble is being shown. | 132 // If the sync promo NTP bubble is being shown. |
133 bool showing_sync_bubble_; | 133 bool showing_sync_bubble_; |
134 | 134 |
135 PrefChangeRegistrar pref_change_registrar_; | 135 PrefChangeRegistrar pref_change_registrar_; |
136 | 136 |
137 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 137 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
138 }; | 138 }; |
139 | 139 |
140 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 140 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
OLD | NEW |