| 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_PAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
| 10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
| 11 | 11 |
| 12 class PrefService; | 12 class PrefServiceSimple; |
| 13 class PrefServiceSyncable; |
| 13 class Profile; | 14 class Profile; |
| 14 | 15 |
| 15 // Handler for general New Tab Page functionality that does not belong in a | 16 // Handler for general New Tab Page functionality that does not belong in a |
| 16 // more specialized handler. | 17 // more specialized handler. |
| 17 class NewTabPageHandler : public content::WebUIMessageHandler { | 18 class NewTabPageHandler : public content::WebUIMessageHandler { |
| 18 public: | 19 public: |
| 19 NewTabPageHandler(); | 20 NewTabPageHandler(); |
| 20 | 21 |
| 21 // Register NTP per-profile preferences. | 22 // Register NTP per-profile preferences. |
| 22 static void RegisterUserPrefs(PrefService* prefs); | 23 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 23 | |
| 24 // Register NTP profile-independent preferences. | |
| 25 static void RegisterPrefs(PrefService* prefs); | |
| 26 | 24 |
| 27 // Registers values (strings etc.) for the page. | 25 // Registers values (strings etc.) for the page. |
| 28 static void GetLocalizedValues(Profile* profile, DictionaryValue* values); | 26 static void GetLocalizedValues(Profile* profile, DictionaryValue* values); |
| 29 | 27 |
| 30 private: | 28 private: |
| 31 virtual ~NewTabPageHandler(); | 29 virtual ~NewTabPageHandler(); |
| 32 | 30 |
| 33 // WebUIMessageHandler implementation. | 31 // WebUIMessageHandler implementation. |
| 34 virtual void RegisterMessages() OVERRIDE; | 32 virtual void RegisterMessages() OVERRIDE; |
| 35 | 33 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 static const int kHistogramEnumerationMax = | 78 static const int kHistogramEnumerationMax = |
| 81 (LAST_PAGE_ID >> kPageIdOffset) + 1; | 79 (LAST_PAGE_ID >> kPageIdOffset) + 1; |
| 82 | 80 |
| 83 // Helper to send out promo resource change notification. | 81 // Helper to send out promo resource change notification. |
| 84 void Notify(chrome::NotificationType notification_type); | 82 void Notify(chrome::NotificationType notification_type); |
| 85 | 83 |
| 86 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); | 84 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); |
| 87 }; | 85 }; |
| 88 | 86 |
| 89 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 87 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
| OLD | NEW |