OLD | NEW |
1 // Copyright (c) 2012 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_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 int GetCommandIdForExtension(const extensions::Extension& extension); | 61 int GetCommandIdForExtension(const extensions::Extension& extension); |
62 | 62 |
63 // Gets the extension for a command ID, or NULL if there isn't one. | 63 // Gets the extension for a command ID, or NULL if there isn't one. |
64 const extensions::Extension* GetExtensionForCommandId(int command_id); | 64 const extensions::Extension* GetExtensionForCommandId(int command_id); |
65 | 65 |
66 // content::NotificationObserver implementation. | 66 // content::NotificationObserver implementation. |
67 virtual void Observe(int type, | 67 virtual void Observe(int type, |
68 const content::NotificationSource& source, | 68 const content::NotificationSource& source, |
69 const content::NotificationDetails& details) OVERRIDE; | 69 const content::NotificationDetails& details) OVERRIDE; |
70 | 70 |
71 // Handles "share with X" commands. | |
72 void TriggerExplicitShareIntent(const GURL& share_service_url); | |
73 | |
74 // Handles the "Find places to share" command. Navigates the browser to the | |
75 // web store to find extensions with share intents. | |
76 void NavigateToWebStoreShareIntentsList(); | |
77 | |
78 Browser* browser_; | 71 Browser* browser_; |
79 | 72 |
80 Delegate* delegate_; | 73 Delegate* delegate_; |
81 | 74 |
82 // The share service strings that have commands associated with them. | |
83 typedef std::map<int, GURL> ShareIntentServiceCommandMap; | |
84 ShareIntentServiceCommandMap share_intent_service_ids_; | |
85 | |
86 // The command ID to assign to the next extension that needs one. | 75 // The command ID to assign to the next extension that needs one. |
87 int next_extension_command_id_; | 76 int next_extension_command_id_; |
88 | 77 |
89 // The extension IDs that have commands associated with them. | 78 // The extension IDs that have commands associated with them. |
90 typedef std::map<std::string, int> ExtensionIdCommandMap; | 79 typedef std::map<std::string, int> ExtensionIdCommandMap; |
91 ExtensionIdCommandMap extension_command_ids_; | 80 ExtensionIdCommandMap extension_command_ids_; |
92 | 81 |
93 content::NotificationRegistrar registrar_; | 82 content::NotificationRegistrar registrar_; |
94 | 83 |
95 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonController); | 84 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonController); |
96 }; | 85 }; |
97 | 86 |
98 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ | 87 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ |
OLD | NEW |