| 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_SHOWN_SECTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/prefs/pref_change_registrar.h" | 9 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 10 #include "content/browser/webui/web_ui.h" | 10 #include "content/browser/webui/web_ui.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 static int GetShownSections(PrefService* pref_service); | 43 static int GetShownSections(PrefService* pref_service); |
| 44 | 44 |
| 45 // Expands |section|, collapsing any previously expanded section. This is the | 45 // Expands |section|, collapsing any previously expanded section. This is the |
| 46 // same thing that happens if a user clicks on |section|. | 46 // same thing that happens if a user clicks on |section|. |
| 47 static void SetShownSection(PrefService* prefs, Section section); | 47 static void SetShownSection(PrefService* prefs, Section section); |
| 48 | 48 |
| 49 // WebUIMessageHandler implementation. | 49 // WebUIMessageHandler implementation. |
| 50 virtual void RegisterMessages(); | 50 virtual void RegisterMessages(); |
| 51 | 51 |
| 52 // NotificationObserver implementation. | 52 // NotificationObserver implementation. |
| 53 virtual void Observe(NotificationType type, | 53 virtual void Observe(int type, |
| 54 const NotificationSource& source, | 54 const NotificationSource& source, |
| 55 const NotificationDetails& details); | 55 const NotificationDetails& details); |
| 56 | 56 |
| 57 // Callback for "getShownSections" message. | 57 // Callback for "getShownSections" message. |
| 58 void HandleGetShownSections(const ListValue* args); | 58 void HandleGetShownSections(const ListValue* args); |
| 59 | 59 |
| 60 // Callback for "setShownSections" message. | 60 // Callback for "setShownSections" message. |
| 61 void HandleSetShownSections(const ListValue* args); | 61 void HandleSetShownSections(const ListValue* args); |
| 62 | 62 |
| 63 static void RegisterUserPrefs(PrefService* pref_service); | 63 static void RegisterUserPrefs(PrefService* pref_service); |
| 64 | 64 |
| 65 static void MigrateUserPrefs(PrefService* pref_service, | 65 static void MigrateUserPrefs(PrefService* pref_service, |
| 66 int old_pref_version, | 66 int old_pref_version, |
| 67 int new_pref_version); | 67 int new_pref_version); |
| 68 | 68 |
| 69 static void OnExtensionInstalled(PrefService* prefs, | 69 static void OnExtensionInstalled(PrefService* prefs, |
| 70 const Extension* extension); | 70 const Extension* extension); |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 PrefService* pref_service_; | 73 PrefService* pref_service_; |
| 74 PrefChangeRegistrar pref_registrar_; | 74 PrefChangeRegistrar pref_registrar_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); | 76 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_ | 79 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_ |
| OLD | NEW |