NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / extensions / location_bar_controller.h
blobee99c443c071fe93131465fa3dc01d3445b55ed6
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,
28 virtual ~LocationBarController() {}
30 // Gets the action data for all extensions.
31 virtual std::vector<ExtensionAction*> GetCurrentActions() const = 0;
33 // Notifies this that the badge for an extension has been clicked with some
34 // mouse button (1 for left, 2 for middle, and 3 for right click), and
35 // returns the action that should be taken in response (if any).
36 // TODO(kalman): make mouse_button an enum.
37 virtual Action OnClicked(const std::string& extension_id,
38 int mouse_button) = 0;
40 // Notifies clients that the icons have changed.
41 virtual void NotifyChange() = 0;
44 } // namespace extensions
46 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_