blob: 9540d2c3a024b3003c2d3d3668acd4e803744ceb [file] [log] [blame]
apacible86792f62015-04-19 03:40:001// Copyright 2015 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.
4
5#ifndef CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_
6#define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_
7
8#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
9
imcheng12fcff42015-06-04 18:37:1210namespace media_router {
11class MediaRouterDialogController;
12} // namespace media_router
13
apacible86792f62015-04-19 03:40:0014// The class for the Media Router component action that will be shown in
15// the toolbar.
16class MediaRouterAction : public ToolbarActionViewController {
17 public:
18 MediaRouterAction();
19 ~MediaRouterAction() override;
20
21 // ToolbarActionViewController implementation.
22 const std::string& GetId() const override;
23 void SetDelegate(ToolbarActionViewDelegate* delegate) override;
rdevlin.cronin3a57a7f2015-07-06 21:22:4324 gfx::Image GetIcon(content::WebContents* web_contents,
25 const gfx::Size& size) override;
apacible86792f62015-04-19 03:40:0026 base::string16 GetActionName() const override;
27 base::string16 GetAccessibleName(content::WebContents* web_contents)
28 const override;
29 base::string16 GetTooltip(content::WebContents* web_contents)
30 const override;
31 bool IsEnabled(content::WebContents* web_contents) const override;
32 bool WantsToRun(content::WebContents* web_contents) const override;
33 bool HasPopup(content::WebContents* web_contents) const override;
34 void HidePopup() override;
35 gfx::NativeView GetPopupNativeView() override;
36 ui::MenuModel* GetContextMenu() override;
apacible86792f62015-04-19 03:40:0037 bool CanDrag() const override;
38 bool ExecuteAction(bool by_user) override;
39 void UpdateState() override;
rdevlin.croninac27cf32015-07-09 17:12:3440 bool DisabledClickOpensMenu() const override;
apacible86792f62015-04-19 03:40:0041
42 private:
imcheng12fcff42015-06-04 18:37:1243 // Returns a reference to the MediaRouterDialogController associated with
44 // |delegate_|'s current WebContents. Guaranteed to be non-null.
45 // |delegate_| and its current WebContents must not be null.
46 media_router::MediaRouterDialogController* GetMediaRouterDialogController();
47
apacible86792f62015-04-19 03:40:0048 const std::string id_;
49 const base::string16 name_;
50
51 // Cached icons.
52 gfx::Image media_router_idle_icon_;
53
54 ToolbarActionViewDelegate* delegate_;
55
56 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction);
57};
58
59#endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_