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_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... |
22 // The reaction that the UI should take after executing |OnClicked|. | 22 // The reaction that the UI should take after executing |OnClicked|. |
23 enum Action { | 23 enum Action { |
24 ACTION_NONE, | 24 ACTION_NONE, |
25 ACTION_SHOW_POPUP, | 25 ACTION_SHOW_POPUP, |
26 ACTION_SHOW_CONTEXT_MENU, | 26 ACTION_SHOW_CONTEXT_MENU, |
27 ACTION_SHOW_SCRIPT_POPUP, | 27 ACTION_SHOW_SCRIPT_POPUP, |
28 }; | 28 }; |
29 | 29 |
30 virtual ~LocationBarController() {} | 30 virtual ~LocationBarController() {} |
31 | 31 |
32 // Utility to add any actions to |out| which aren't present in |actions|. | |
33 static void AddMissingActions( | |
34 const std::set<ExtensionAction*>& actions, | |
35 std::vector<ExtensionAction*>* out); | |
36 | |
37 // Gets the action data for all extensions. | 32 // Gets the action data for all extensions. |
38 virtual std::vector<ExtensionAction*> GetCurrentActions() = 0; | 33 virtual std::vector<ExtensionAction*> GetCurrentActions() const = 0; |
39 | 34 |
40 // Notifies this that the badge for an extension has been clicked with some | 35 // Notifies this that the badge for an extension has been clicked with some |
41 // mouse button (1 for left, 2 for middle, and 3 for right click), and | 36 // mouse button (1 for left, 2 for middle, and 3 for right click), and |
42 // returns the action that should be taken in response (if any). | 37 // returns the action that should be taken in response (if any). |
43 // TODO(kalman): make mouse_button an enum. | 38 // TODO(kalman): make mouse_button an enum. |
44 virtual Action OnClicked(const std::string& extension_id, | 39 virtual Action OnClicked(const std::string& extension_id, |
45 int mouse_button) = 0; | 40 int mouse_button) = 0; |
46 | 41 |
47 // Notifies clients that the icons have changed. | 42 // Notifies clients that the icons have changed. |
48 virtual void NotifyChange() = 0; | 43 virtual void NotifyChange() = 0; |
49 }; | 44 }; |
50 | 45 |
51 } // namespace extensions | 46 } // namespace extensions |
52 | 47 |
53 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ | 48 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ |
OLD | NEW |