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
,
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_