| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_SHOWN_SECTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/dom_ui/dom_ui.h" | 8 #include "chrome/browser/dom_ui/dom_ui.h" |
| 9 | 9 |
| 10 class DOMUI; | 10 class DOMUI; |
| 11 class Value; | 11 class Value; |
| 12 class PrefService; | 12 class PrefService; |
| 13 | 13 |
| 14 // Use for the shown sections bitmask. | 14 // Use for the shown sections bitmask. |
| 15 enum Section { | 15 enum Section { |
| 16 THUMB = 1, | 16 THUMB = 1, |
| 17 LIST = 2, | 17 LIST = 2, |
| 18 RECENT = 4, | 18 RECENT = 4, |
| 19 TIPS = 8 | 19 TIPS = 8 |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 class ShownSectionsHandler : public DOMMessageHandler { | 22 class ShownSectionsHandler : public DOMMessageHandler { |
| 23 public: | 23 public: |
| 24 explicit ShownSectionsHandler(DOMUI* dom_ui); | 24 ShownSectionsHandler() { } |
| 25 virtual ~ShownSectionsHandler() { } |
| 26 |
| 27 // DOMMessageHandler implementation. |
| 28 virtual void RegisterMessages(); |
| 25 | 29 |
| 26 // Callback for "getShownSections" message. | 30 // Callback for "getShownSections" message. |
| 27 void HandleGetShownSections(const Value* value); | 31 void HandleGetShownSections(const Value* value); |
| 28 | 32 |
| 29 // Callback for "setShownSections" message. | 33 // Callback for "setShownSections" message. |
| 30 void HandleSetShownSections(const Value* value); | 34 void HandleSetShownSections(const Value* value); |
| 31 | 35 |
| 32 static void RegisterUserPrefs(PrefService* prefs); | 36 static void RegisterUserPrefs(PrefService* prefs); |
| 33 | 37 |
| 34 private: | 38 private: |
| 35 DOMUI* dom_ui_; | 39 DOMUI* dom_ui_; |
| 36 | 40 |
| 37 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); | 41 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); |
| 38 }; | 42 }; |
| 39 | 43 |
| 40 #endif // CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ | 44 #endif // CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ |
| OLD | NEW |