Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / extensions / location_bar_controller.h
blob4814b21ea49366268f124bb8ec52f47ddb4b65ea
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_
8 #include <set>
9 #include <string>
10 #include <vector>
12 class ExtensionAction;
14 namespace extensions {
16 // Interface for a class that controls the the extension icons that show up in
17 // the location bar. Depending on switches, these icons can have differing
18 // behavior.
19 class LocationBarController {
20 public:
21 // The reaction that the UI should take after executing |OnClicked|.
22 enum Action {
23 ACTION_NONE,
24 ACTION_SHOW_POPUP,
25 ACTION_SHOW_CONTEXT_MENU,
26 ACTION_SHOW_SCRIPT_POPUP,
29 virtual ~LocationBarController() {}
31 // Gets the action data for all extensions.
32 virtual std::vector<ExtensionAction*> GetCurrentActions() const = 0;
34 // Invites the user to click on |extension_id|'s script badge, due to a
35 // scriptBadge.getAttention() call.
36 virtual void GetAttentionFor(const std::string& extension_id) = 0;
38 // Notifies this that the badge for an extension has been clicked with some
39 // mouse button (1 for left, 2 for middle, and 3 for right click), and
40 // returns the action that should be taken in response (if any).
41 // TODO(kalman): make mouse_button an enum.
42 virtual Action OnClicked(const std::string& extension_id,
43 int mouse_button) = 0;
45 // Notifies clients that the icons have changed.
46 virtual void NotifyChange() = 0;
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_