| Index: chrome/browser/ui/toolbar/media_router_action.h
|
| diff --git a/chrome/browser/ui/toolbar/media_router_action.h b/chrome/browser/ui/toolbar/media_router_action.h
|
| index ace06a32f18e0cdfe7f86ea861e907c9cdadf917..f5ea020cc26e414d4a6f151820fd833c2d30b8b9 100644
|
| --- a/chrome/browser/ui/toolbar/media_router_action.h
|
| +++ b/chrome/browser/ui/toolbar/media_router_action.h
|
| @@ -5,6 +5,9 @@
|
| #ifndef CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_
|
| #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_
|
|
|
| +#include <memory>
|
| +#include <string>
|
| +
|
| #include "base/macros.h"
|
| #include "base/scoped_observer.h"
|
| #include "chrome/browser/media/router/issues_observer.h"
|
| @@ -13,6 +16,7 @@
|
| #include "chrome/browser/ui/toolbar/media_router_contextual_menu.h"
|
| #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
|
| #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
|
| +#include "chrome/browser/ui/toolbar/toolbar_actions_bar_observer.h"
|
| #include "ui/gfx/vector_icons_public.h"
|
|
|
| class Browser;
|
| @@ -28,7 +32,8 @@ class MediaRouterDialogControllerImpl;
|
| class MediaRouterAction : public ToolbarActionViewController,
|
| public media_router::IssuesObserver,
|
| public media_router::MediaRoutesObserver,
|
| - public TabStripModelObserver {
|
| + public TabStripModelObserver,
|
| + public ToolbarActionsBarObserver {
|
| public:
|
| MediaRouterAction(Browser* browser, ToolbarActionsBar* toolbar_actions_bar);
|
| ~MediaRouterAction() override;
|
| @@ -67,16 +72,22 @@ class MediaRouterAction : public ToolbarActionViewController,
|
| int index,
|
| int reason) override;
|
|
|
| - void OnPopupHidden();
|
| - void OnPopupShown();
|
| + // ToolbarActionsBarObserver:
|
| + void OnToolbarActionsBarAnimationEnded() override;
|
| +
|
| + void OnDialogHidden();
|
| + void OnDialogShown();
|
|
|
| private:
|
| - // Called when a new browser window is opened, the user switches tabs in the
|
| - // browser window, or when |delegate_| is swapped out to be non-null and has
|
| - // a valid WebContents.
|
| + // Registers |this| with the MediaRouterDialogControllerImpl associated with
|
| + // |delegate_|'s current WebContents if |this| is not shown in overflow mode.
|
| + void RegisterWithDialogController();
|
| +
|
| + // Called when a new browser window is opened or when |delegate_| is swapped
|
| + // out to be non-null and has a valid WebContents.
|
| // This updates the pressed/unpressed state of the icon, which is different
|
| // on a per-tab basis.
|
| - void UpdatePopupState();
|
| + void UpdateDialogState();
|
|
|
| // Returns a reference to the MediaRouterDialogControllerImpl associated with
|
| // |delegate_|'s current WebContents. Guaranteed to be non-null.
|
| @@ -105,6 +116,10 @@ class MediaRouterAction : public ToolbarActionViewController,
|
| // Whether a local displayable active route exists.
|
| bool has_local_display_route_;
|
|
|
| + // Whether the Media Router dialog is shown in the current tab.
|
| + // This should only be updated in OnDialogShown() and OnDialogHidden().
|
| + bool has_dialog_;
|
| +
|
| ToolbarActionViewDelegate* delegate_;
|
|
|
| Browser* const browser_;
|
| @@ -117,6 +132,8 @@ class MediaRouterAction : public ToolbarActionViewController,
|
|
|
| ScopedObserver<TabStripModel, TabStripModelObserver>
|
| tab_strip_model_observer_;
|
| + ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver>
|
| + toolbar_actions_bar_observer_;
|
|
|
| base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_;
|
|
|
|
|