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

Unified Diff: chrome/browser/ui/webui/settings/protocol_handlers_handler.h

Issue 2131953002: Site Settings Desktop: Implement protocol handler section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.cc ('k') | chrome/browser/ui/webui/settings/protocol_handlers_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698