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_
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
19 class LocationBarController
{
21 // The reaction that the UI should take after executing |OnClicked|.
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_