OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/dom_ui/dom_ui.h" | 9 #include "chrome/browser/dom_ui/dom_ui.h" |
10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
11 | 11 |
12 class DOMUI; | 12 class DOMUI; |
13 class Value; | 13 class Value; |
14 class PrefService; | 14 class PrefService; |
15 | 15 |
16 // Use for the shown sections bitmask. | 16 // Use for the shown sections bitmask. |
| 17 // Currently, only the THUMB and APPS sections can be toggled by the user. Other |
| 18 // sections are shown automatically if they have data, and hidden otherwise. |
17 enum Section { | 19 enum Section { |
18 THUMB = 1, | 20 THUMB = 1, |
19 LIST = 2, | |
20 RECENT = 4, | |
21 TIPS = 8, | |
22 SYNC = 16, | |
23 DEBUG = 32, | |
24 APPS = 64 | 21 APPS = 64 |
25 }; | 22 }; |
26 | 23 |
27 class ShownSectionsHandler : public DOMMessageHandler, | 24 class ShownSectionsHandler : public DOMMessageHandler, |
28 public NotificationObserver { | 25 public NotificationObserver { |
29 public: | 26 public: |
30 explicit ShownSectionsHandler(PrefService* pref_service); | 27 explicit ShownSectionsHandler(PrefService* pref_service); |
31 virtual ~ShownSectionsHandler(); | 28 virtual ~ShownSectionsHandler(); |
32 | 29 |
33 // Helper to get the current shown sections. | 30 // Helper to get the current shown sections. |
(...skipping 19 matching lines...) Expand all Loading... |
53 int old_pref_version, | 50 int old_pref_version, |
54 int new_pref_version); | 51 int new_pref_version); |
55 | 52 |
56 private: | 53 private: |
57 PrefService* pref_service_; | 54 PrefService* pref_service_; |
58 | 55 |
59 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); | 56 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); |
60 }; | 57 }; |
61 | 58 |
62 #endif // CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ | 59 #endif // CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ |
OLD | NEW |