diff options
Diffstat (limited to 'chrome/browser/ui/webui/ntp/new_tab_page_handler.h')
-rw-r--r-- | chrome/browser/ui/webui/ntp/new_tab_page_handler.h | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_handler.h b/chrome/browser/ui/webui/ntp/new_tab_page_handler.h deleted file mode 100644 index 715b25e..0000000 --- a/chrome/browser/ui/webui/ntp/new_tab_page_handler.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2012 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_NEW_TAB_PAGE_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ - -#include <stddef.h> - -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "base/values.h" -#include "content/public/browser/web_ui_message_handler.h" - -class PrefRegistrySimple; -class Profile; - -namespace user_prefs { -class PrefRegistrySyncable; -} - -// Handler for general New Tab Page functionality that does not belong in a -// more specialized handler. -class NewTabPageHandler : public content::WebUIMessageHandler, - public base::SupportsWeakPtr<NewTabPageHandler> { - public: - NewTabPageHandler(); - - // Register NTP per-profile preferences. - static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); - - // Registers values (strings etc.) for the page. - static void GetLocalizedValues(Profile* profile, - base::DictionaryValue* values); - - private: - ~NewTabPageHandler() override; - - // WebUIMessageHandler implementation. - void RegisterMessages() override; - - // Callback for "pageSelected". - void HandlePageSelected(const base::ListValue* args); - - // Tracks the number of times the user has switches pages (for UMA). - size_t page_switch_count_; - - // The purpose of this enum is to track which page on the NTP is showing. - // The lower 10 bits of kNtpShownPage are used for the index within the page - // group, and the rest of the bits are used for the page group ID (defined - // here). - static const int kPageIdOffset = 10; - enum { - INDEX_MASK = (1 << kPageIdOffset) - 1, - APPS_PAGE_ID = 2 << kPageIdOffset, - LAST_PAGE_ID = APPS_PAGE_ID, - }; - static const int kHistogramEnumerationMax = - (LAST_PAGE_ID >> kPageIdOffset) + 1; - - DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); -}; - -#endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |