Index: chrome/browser/ui/webui/options2/web_intents_defaults_handler.h |
diff --git a/chrome/browser/ui/webui/options2/web_intents_defaults_handler.h b/chrome/browser/ui/webui/options2/web_intents_defaults_handler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..af7604475c4f92bf9238b5551def26263da68429 |
--- /dev/null |
+++ b/chrome/browser/ui/webui/options2/web_intents_defaults_handler.h |
@@ -0,0 +1,48 @@ |
+// 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_OPTIONS2_MEDIA_GALLERY_HANDLER_H_ |
+#define CHROME_BROWSER_UI_WEBUI_OPTIONS2_MEDIA_GALLERY_HANDLER_H_ |
csilv
2012/08/09 18:18:04
CHROME_BROWSER_UI_WEBUI_OPTIONS2_WEB_INTENTS_DEFAU
|
+ |
+#include "chrome/browser/intents/default_web_intent_service.h" |
+#include "chrome/browser/intents/web_intents_registry.h" |
+#include "chrome/browser/ui/webui/options2/options_ui.h" |
+#include "content/public/browser/notification_observer.h" |
+ |
+namespace options2 { |
+ |
+// Handles messages related to adding or removing media galleries. |
+class WebIntentsDefaultsHandler : public OptionsPageUIHandler { |
+ public: |
+ WebIntentsDefaultsHandler(); |
+ virtual ~WebIntentsDefaultsHandler(); |
+ |
+ // OptionsPageUIHandler implementation. |
+ virtual void GetLocalizedValues(base::DictionaryValue* values) OVERRIDE; |
+ virtual void InitializeHandler() OVERRIDE; |
+ virtual void InitializePage() OVERRIDE; |
+ virtual void RegisterMessages() OVERRIDE; |
+ |
+ // NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ |
+ private: |
+ // Handles the "removeDefault" message. The first and only argument |
+ // of concern is the service_url of the defaults to be removed. |
+ void HandleRemoveServiceDefaults(const base::ListValue* args); |
+ |
+ // Called when the list of known defaults has changed; updates the page. |
+ void UpdateServiceList(); |
+ |
+ void OnServicesLoaded(const std::vector<DefaultWebIntentService>& services); |
+ |
+ WebIntentsRegistry* GetRegistry(); |
+ DISALLOW_COPY_AND_ASSIGN(WebIntentsDefaultsHandler); |
+}; |
+ |
+} // namespace options2 |
+ |
+#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_MEDIA_GALLERY_HANDLER_H_ |