Commit 0a9c22d4 authored by takumif's avatar takumif Committed by Commit bot

Allow MediaRouterDialogControllerImpl to re-set its reference to MRAction

When a tab that a dialog controller is associated with gets moved to another
window, we need to allow the dialog controller to update its reference to the
toolbar action (associated with a window). This fixes the bug in which the
icon gets pressed in a wrong window.

The comment for SetMediaRouterAction() is also updated, as it is okay for the
action to be null, and we expect it to become null when it gets removed from
the toolbar.

BUG=644972

Review-Url: https://codereview.chromium.org/2321163002
Cr-Commit-Position: refs/heads/master@{#417376}
parent 8eefc213
......@@ -173,8 +173,7 @@ WebContents* MediaRouterDialogControllerImpl::GetMediaRouterDialog() const {
void MediaRouterDialogControllerImpl::SetMediaRouterAction(
const base::WeakPtr<MediaRouterAction>& action) {
if (!action_)
action_ = action;
action_ = action;
}
bool MediaRouterDialogControllerImpl::IsShowingMediaRouterDialog() const {
......
......@@ -33,7 +33,7 @@ class MediaRouterDialogControllerImpl :
// Returns nullptr if there is no dialog.
content::WebContents* GetMediaRouterDialog() const;
// |action| must always be non-null.
// Sets the action to notify when a dialog gets shown or hidden.
void SetMediaRouterAction(const base::WeakPtr<MediaRouterAction>& action);
// MediaRouterDialogController:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment