| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_DOM_UI_NEW_TAB_UI_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_ | 6 #define CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/dom_ui/dom_ui.h" | 8 #include "chrome/browser/dom_ui/dom_ui.h" |
| 9 #include "chrome/common/notification_registrar.h" | 9 #include "chrome/common/notification_registrar.h" |
| 10 | 10 |
| 11 class GURL; | 11 class GURL; |
| 12 class PrefService; | 12 class PrefService; |
| 13 class Profile; | 13 class Profile; |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 class NewTabHTMLSource; | 16 class NewTabHTMLSource; |
| 17 } | 17 } |
| 18 | 18 |
| 19 // The TabContents used for the New Tab page. | 19 // The TabContents used for the New Tab page. |
| 20 class NewTabUI : public DOMUI, | 20 class NewTabUI : public DOMUI, |
| 21 public NotificationObserver { | 21 public NotificationObserver { |
| 22 public: | 22 public: |
| 23 explicit NewTabUI(TabContents* manager); | 23 explicit NewTabUI(TabContents* manager); |
| 24 ~NewTabUI(); | 24 ~NewTabUI(); |
| 25 | 25 |
| 26 static void RegisterUserPrefs(PrefService* prefs); | 26 static void RegisterUserPrefs(PrefService* prefs); |
| 27 | 27 |
| 28 // Whether we should use the prototype new tab page. | 28 // Whether we should use the old new tab page. |
| 29 static bool EnableNewNewTabPage(); | 29 static bool UseOldNewTabPage(); |
| 30 | 30 |
| 31 // Whether we should enable the web resources backend service | 31 // Whether we should enable the web resources backend service |
| 32 static bool EnableWebResources(); | 32 static bool EnableWebResources(); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 void Observe(NotificationType type, | 35 void Observe(NotificationType type, |
| 36 const NotificationSource& source, | 36 const NotificationSource& source, |
| 37 const NotificationDetails& details); | 37 const NotificationDetails& details); |
| 38 | 38 |
| 39 NotificationRegistrar registrar_; | 39 NotificationRegistrar registrar_; |
| 40 | 40 |
| 41 // The message id that should be displayed in this NewTabUIContents | 41 // The message id that should be displayed in this NewTabUIContents |
| 42 // instance's motd area. | 42 // instance's motd area. |
| 43 int motd_message_id_; | 43 int motd_message_id_; |
| 44 | 44 |
| 45 // Whether the user is in incognito mode or not, used to determine | 45 // Whether the user is in incognito mode or not, used to determine |
| 46 // what HTML to load. | 46 // what HTML to load. |
| 47 bool incognito_; | 47 bool incognito_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 49 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 #endif // CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_ | 52 #endif // CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_ |
| OLD | NEW |