OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_HANDLER_OPTIONS_HANDLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_HANDLER_OPTIONS_HANDLER_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
Evan Stade
2011/05/20 22:01:28
include this in the cc file
koz (OOO until 15th September)
2011/05/20 22:19:56
Done.
| |
10 | |
11 #include "chrome/browser/custom_handlers/protocol_handler.h" | |
12 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | |
13 #include "chrome/browser/ui/webui/options/options_ui.h" | |
14 #include "content/common/notification_registrar.h" | |
15 | |
16 class DictionaryValue; | |
17 | |
18 class HandlerOptionsHandler : public OptionsPageUIHandler { | |
19 public: | |
20 explicit HandlerOptionsHandler(); | |
21 virtual ~HandlerOptionsHandler(); | |
22 | |
23 // OptionsPageUIHandler implementation. | |
24 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | |
25 virtual void Initialize(); | |
26 virtual void RegisterMessages(); | |
27 | |
28 // NotificationObserver implementation. | |
29 virtual void Observe(NotificationType type, | |
30 const NotificationSource& source, | |
31 const NotificationDetails& details); | |
32 | |
33 private: | |
34 // Called when the user toggles whether custom handlers are enabled. | |
35 void SetHandlersEnabled(const ListValue* args); | |
36 | |
37 // Called when the user sets a new default handler for a protocol. | |
38 void SetDefault(const ListValue* args); | |
39 | |
40 // Parses a ProtocolHandler out of the arguments passed back from the view. | |
41 // |args| a list of [protocol, url, title]. | |
Evan Stade
2011/05/20 22:01:28
nit: |args| _is_ a list...
koz (OOO until 15th September)
2011/05/20 22:19:56
Done.
| |
42 ProtocolHandler ParseHandlerFromArgs(const ListValue* args) const; | |
43 | |
44 // Returns a JSON object describing the set of protocol handlers for the | |
45 // given protocol. | |
46 DictionaryValue* GetHandlersForProtocol(const std::string& protocol); | |
47 | |
48 // Called when the JS PasswordManager object is initialized. | |
49 void UpdateHandlerList(); | |
50 | |
51 // Remove a handler. | |
52 // |args| a list of [protocol, url, title]. | |
53 void RemoveHandler(const ListValue* args); | |
54 | |
55 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | |
56 | |
57 NotificationRegistrar notification_registrar_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(HandlerOptionsHandler); | |
60 }; | |
61 | |
62 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_HANDLER_OPTIONS_HANDLER_H_ | |
OLD | NEW |