Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome/browser/extensions/location_bar_controller.h

Issue 10544195: Show an extension info bubble when a script badge is clicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 14
15 class ExtensionAction; 15 class ExtensionAction;
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 // Interface for a class that controls the the extension icons that show up in 19 // Interface for a class that controls the the extension icons that show up in
20 // the location bar. Depending on switches, these icons can have differing 20 // the location bar. Depending on switches, these icons can have differing
21 // behavior. 21 // behavior.
22 class LocationBarController { 22 class LocationBarController {
23 public: 23 public:
24 // The reaction that the UI should take after executing |OnClicked|. 24 // The reaction that the UI should take after executing |OnClicked|.
25 enum Action { 25 enum Action {
26 ACTION_NONE, 26 ACTION_NONE,
27 ACTION_SHOW_POPUP, 27 ACTION_SHOW_POPUP,
28 ACTION_SHOW_CONTEXT_MENU, 28 ACTION_SHOW_CONTEXT_MENU,
29 ACTION_SHOW_SCRIPT_POPUP,
29 }; 30 };
30 31
31 virtual ~LocationBarController() {} 32 virtual ~LocationBarController() {}
32 33
33 // Utility to add any actions to |out| which aren't present in |actions|. 34 // Utility to add any actions to |out| which aren't present in |actions|.
34 static void AddMissingActions( 35 static void AddMissingActions(
35 const std::set<ExtensionAction*>& actions, 36 const std::set<ExtensionAction*>& actions,
36 std::vector<ExtensionAction*>* out); 37 std::vector<ExtensionAction*>* out);
37 38
38 // Gets the action data for all extensions. 39 // Gets the action data for all extensions.
39 virtual scoped_ptr<std::vector<ExtensionAction*> > GetCurrentActions() = 0; 40 virtual scoped_ptr<std::vector<ExtensionAction*> > GetCurrentActions() = 0;
40 41
41 // Notifies this that the badge for an extension has been clicked with some 42 // Notifies this that the badge for an extension has been clicked with some
42 // mouse button (1 for left, 2 for middle, and 3 for right click), and 43 // mouse button (1 for left, 2 for middle, and 3 for right click), and
43 // returns the action that should be taken in response (if any). 44 // returns the action that should be taken in response (if any).
44 // TODO(kalman): make mouse_button an enum. 45 // TODO(kalman): make mouse_button an enum.
45 virtual Action OnClicked(const std::string& extension_id, 46 virtual Action OnClicked(const std::string& extension_id,
46 int mouse_button) = 0; 47 int mouse_button) = 0;
47 }; 48 };
48 49
49 } // namespace extensions 50 } // namespace extensions
50 51
51 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ 52 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698