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

Unified Diff: chrome/browser/ui/webui/ntp/shown_sections_handler.h

Issue 8438028: ntp: remove ShownSectionHandler and all references to it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more functional test updates Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/ntp/shown_sections_handler.h
diff --git a/chrome/browser/ui/webui/ntp/shown_sections_handler.h b/chrome/browser/ui/webui/ntp/shown_sections_handler.h
deleted file mode 100644
index 745cbb10f4d3d7f41dbd1b1f94d64e82174a9c99..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/webui/ntp/shown_sections_handler.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_
-#define CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_
-#pragma once
-
-#include "chrome/browser/prefs/pref_change_registrar.h"
-#include "content/browser/webui/web_ui.h"
-#include "content/public/browser/notification_observer.h"
-
-class Extension;
-class PrefService;
-
-namespace base {
-class Value;
-}
-
-// Use for the shown sections bitmask.
-// Currently, only the THUMB and APPS sections can be toggled by the user. Other
-// sections are shown automatically if they have data, and hidden otherwise.
-enum Section {
- // If one of these is set, the corresponding section shows large thumbnails,
- // else it shows only a small overview list.
- THUMB = 1 << 0,
- APPS = 1 << 6,
-
- // We use the low 16 bits for sections, the high 16 bits for menu mode.
- ALL_SECTIONS_MASK = 0x0000FFFF,
-
- // If one of these is set, then the corresponding section is shown in a menu
- // at the bottom of the NTP and no data is directly visible on the NTP.
- MENU_THUMB = 1 << (0 + 16),
- MENU_RECENT = 1 << (2 + 16),
- MENU_APPS = 1 << (6 + 16),
-};
-
-class ShownSectionsHandler : public WebUIMessageHandler,
- public content::NotificationObserver {
- public:
- explicit ShownSectionsHandler(PrefService* pref_service);
- virtual ~ShownSectionsHandler() {}
-
- // Helper to get the current shown sections.
- static int GetShownSections(PrefService* pref_service);
-
- // Expands |section|, collapsing any previously expanded section. This is the
- // same thing that happens if a user clicks on |section|.
- static void SetShownSection(PrefService* prefs, Section section);
-
- // WebUIMessageHandler implementation.
- virtual void RegisterMessages() OVERRIDE;
-
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // Callback for "setShownSections" message.
- void HandleSetShownSections(const base::ListValue* args);
-
- static void RegisterUserPrefs(PrefService* pref_service);
-
- static void MigrateUserPrefs(PrefService* pref_service,
- int old_pref_version,
- int new_pref_version);
-
- static void OnExtensionInstalled(PrefService* prefs,
- const Extension* extension);
-
- private:
- PrefService* pref_service_;
- PrefChangeRegistrar pref_registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(ShownSectionsHandler);
-};
-
-#endif // CHROME_BROWSER_UI_WEBUI_NTP_SHOWN_SECTIONS_HANDLER_H_
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/browser/ui/webui/ntp/shown_sections_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698