OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_HANDLER_OPTIONS_HANDLER2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_HANDLER_OPTIONS_HANDLER2_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_HANDLER_OPTIONS_HANDLER2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_HANDLER_OPTIONS_HANDLER2_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
11 #include "chrome/browser/ui/webui/options2/options_ui2.h" | 11 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
12 #include "chrome/common/custom_handlers/protocol_handler.h" | 12 #include "chrome/common/custom_handlers/protocol_handler.h" |
13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
14 | 14 |
| 15 //////////////////////////////////////////////////////////////////////////////// |
| 16 // HandlerOptionsHandler |
| 17 |
| 18 // Listen for changes to protocol handlers (i.e. registerProtocolHandler()). |
| 19 // This get triggered whenever a user allows a specific website or application |
| 20 // to handle clicks on a link with a specified protocol (i.e. mailto: -> Gmail). |
| 21 |
15 namespace base { | 22 namespace base { |
16 class DictionaryValue; | 23 class DictionaryValue; |
17 } | 24 } |
18 | 25 |
19 namespace options2 { | 26 namespace options2 { |
20 | 27 |
21 class HandlerOptionsHandler : public OptionsPageUIHandler { | 28 class HandlerOptionsHandler : public OptionsPageUIHandler { |
22 public: | 29 public: |
23 HandlerOptionsHandler(); | 30 HandlerOptionsHandler(); |
24 virtual ~HandlerOptionsHandler(); | 31 virtual ~HandlerOptionsHandler(); |
25 | 32 |
26 // OptionsPageUIHandler implementation. | 33 // OptionsPageUIHandler implementation. |
27 virtual void GetLocalizedValues( | 34 virtual void GetLocalizedValues( |
28 base::DictionaryValue* localized_strings) OVERRIDE; | 35 base::DictionaryValue* localized_strings) OVERRIDE; |
29 virtual void Initialize() OVERRIDE; | 36 virtual void InitializeHandler() OVERRIDE; |
| 37 virtual void InitializePage() OVERRIDE; |
30 virtual void RegisterMessages() OVERRIDE; | 38 virtual void RegisterMessages() OVERRIDE; |
31 | 39 |
32 // content::NotificationObserver implementation. | 40 // content::NotificationObserver implementation. |
33 virtual void Observe(int type, | 41 virtual void Observe(int type, |
34 const content::NotificationSource& source, | 42 const content::NotificationSource& source, |
35 const content::NotificationDetails& details) OVERRIDE; | 43 const content::NotificationDetails& details) OVERRIDE; |
36 | 44 |
37 private: | 45 private: |
38 // Called when the user toggles whether custom handlers are enabled. | 46 // Called when the user toggles whether custom handlers are enabled. |
39 void SetHandlersEnabled(const ListValue* args); | 47 void SetHandlersEnabled(const ListValue* args); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 79 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
72 | 80 |
73 content::NotificationRegistrar notification_registrar_; | 81 content::NotificationRegistrar notification_registrar_; |
74 | 82 |
75 DISALLOW_COPY_AND_ASSIGN(HandlerOptionsHandler); | 83 DISALLOW_COPY_AND_ASSIGN(HandlerOptionsHandler); |
76 }; | 84 }; |
77 | 85 |
78 } // namespace options2 | 86 } // namespace options2 |
79 | 87 |
80 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_HANDLER_OPTIONS_HANDLER2_H_ | 88 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_HANDLER_OPTIONS_HANDLER2_H_ |
OLD | NEW |