Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/browser/dom_ui/shown_sections_handler.h

Issue 3455007: Make it possible to hide "most visited" on nnnnnnntp (Closed)
Patch Set: fix revert reasons Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/dom_ui/shown_sections_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/prefs/pref_change_registrar.h" 11 #include "chrome/browser/prefs/pref_change_registrar.h"
12 12
13 class DOMUI; 13 class DOMUI;
14 class Value; 14 class Value;
15 class PrefService; 15 class PrefService;
16 16
17 // Use for the shown sections bitmask. 17 // Use for the shown sections bitmask.
18 // Currently, only the THUMB and APPS sections can be toggled by the user. Other 18 // Currently, only the THUMB and APPS sections can be toggled by the user. Other
19 // sections are shown automatically if they have data, and hidden otherwise. 19 // sections are shown automatically if they have data, and hidden otherwise.
20 enum Section { 20 enum Section {
21 THUMB = 1, 21 // If one of these is set, the corresponding section shows large thumbnails,
22 APPS = 64 22 // else it shows only a small overview list.
23 THUMB = 1 << 0,
24 APPS = 1 << 6,
25
26 // If one of these is set, then the corresponding section is shown minimized
27 // at the bottom of the NTP and no data is directly visible on the NTP.
28 MINIMIZED_THUMB = 1 << (0 + 16),
29 MINIMIZED_RECENT = 1 << (2 + 16),
30 MINIMIZED_APPS = 1 << (6 + 16),
23 }; 31 };
24 32
25 class ShownSectionsHandler : public DOMMessageHandler, 33 class ShownSectionsHandler : public DOMMessageHandler,
26 public NotificationObserver { 34 public NotificationObserver {
27 public: 35 public:
28 explicit ShownSectionsHandler(PrefService* pref_service); 36 explicit ShownSectionsHandler(PrefService* pref_service);
29 virtual ~ShownSectionsHandler() {} 37 virtual ~ShownSectionsHandler() {}
30 38
31 // Helper to get the current shown sections. 39 // Helper to get the current shown sections.
32 static int GetShownSections(PrefService* pref_service); 40 static int GetShownSections(PrefService* pref_service);
(...skipping 19 matching lines...) Expand all
52 int new_pref_version); 60 int new_pref_version);
53 61
54 private: 62 private:
55 PrefService* pref_service_; 63 PrefService* pref_service_;
56 PrefChangeRegistrar registrar_; 64 PrefChangeRegistrar registrar_;
57 65
58 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler); 66 DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler);
59 }; 67 };
60 68
61 #endif // CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_ 69 #endif // CHROME_BROWSER_DOM_UI_SHOWN_SECTIONS_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/shown_sections_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698