| Index: chrome/browser/ui/webui/settings/protocol_handlers_handler.h
|
| diff --git a/chrome/browser/ui/webui/options/handler_options_handler.h b/chrome/browser/ui/webui/settings/protocol_handlers_handler.h
|
| similarity index 72%
|
| copy from chrome/browser/ui/webui/options/handler_options_handler.h
|
| copy to chrome/browser/ui/webui/settings/protocol_handlers_handler.h
|
| index f1b49acbabc00df34e9eac5310c5558b2e224425..87a38241df93400b97cd7cecf9f45c2b8d1c950e 100644
|
| --- a/chrome/browser/ui/webui/options/handler_options_handler.h
|
| +++ b/chrome/browser/ui/webui/settings/protocol_handlers_handler.h
|
| @@ -1,21 +1,21 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 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_OPTIONS_HANDLER_OPTIONS_HANDLER_H_
|
| -#define CHROME_BROWSER_UI_WEBUI_OPTIONS_HANDLER_OPTIONS_HANDLER_H_
|
| +#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_
|
| +#define CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_
|
|
|
| #include <string>
|
|
|
| #include "base/macros.h"
|
| #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
|
| -#include "chrome/browser/ui/webui/options/options_ui.h"
|
| +#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
|
| #include "chrome/common/custom_handlers/protocol_handler.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// HandlerOptionsHandler
|
| +// ProtocolHandlersHandler
|
|
|
| // Listen for changes to protocol handlers (i.e. registerProtocolHandler()).
|
| // This get triggered whenever a user allows a specific website or application
|
| @@ -25,26 +25,31 @@ namespace base {
|
| class DictionaryValue;
|
| }
|
|
|
| -namespace options {
|
| +namespace settings {
|
|
|
| -class HandlerOptionsHandler : public OptionsPageUIHandler,
|
| +class ProtocolHandlersHandler : public SettingsPageUIHandler,
|
| public content::NotificationObserver {
|
| public:
|
| - HandlerOptionsHandler();
|
| - ~HandlerOptionsHandler() override;
|
| + ProtocolHandlersHandler();
|
| + ~ProtocolHandlersHandler() override;
|
|
|
| - // OptionsPageUIHandler implementation.
|
| - void GetLocalizedValues(base::DictionaryValue* localized_strings) override;
|
| - void InitializeHandler() override;
|
| - void InitializePage() override;
|
| + // SettingsPageUIHandler:
|
| + void OnJavascriptAllowed() override;
|
| + void OnJavascriptDisallowed() override;
|
| void RegisterMessages() override;
|
|
|
| - // content::NotificationObserver implementation.
|
| + // content::NotificationObserver:
|
| void Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) override;
|
|
|
| private:
|
| + // Called to fetch the initial list of data to show.
|
| + void InitializeProtocolHandlerList(const base::ListValue* args);
|
| +
|
| + // Notifies the JS side whether the handlers are enabled or not.
|
| + void SendHandlersEnabledValue();
|
| +
|
| // Called when the user toggles whether custom handlers are enabled.
|
| void SetHandlersEnabled(const base::ListValue* args);
|
|
|
| @@ -82,9 +87,9 @@ class HandlerOptionsHandler : public OptionsPageUIHandler,
|
|
|
| content::NotificationRegistrar notification_registrar_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(HandlerOptionsHandler);
|
| + DISALLOW_COPY_AND_ASSIGN(ProtocolHandlersHandler);
|
| };
|
|
|
| -} // namespace options
|
| +} // namespace settings
|
|
|
| -#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_HANDLER_OPTIONS_HANDLER_H_
|
| +#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_
|
|
|