Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Unified Diff: chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.cc

Issue 1228223002: Close wrench menu when Media Router Action clicked in Views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per rdevlin.cronin@'s comments and rebase. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.cc
diff --git a/chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.cc b/chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.cc
new file mode 100644
index 0000000000000000000000000000000000000000..acc674629135d8a986ddb53222ea0c5f0a598b86
--- /dev/null
+++ b/chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.cc
@@ -0,0 +1,33 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.h"
+
+#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
+
+// static
+scoped_ptr<MediaRouterActionPlatformDelegate>
+MediaRouterActionPlatformDelegate::Create(Browser* browser) {
+ return make_scoped_ptr(new MediaRouterActionPlatformDelegateViews(browser));
+}
+
+MediaRouterActionPlatformDelegateViews::MediaRouterActionPlatformDelegateViews(
+ Browser* browser)
+ : browser_(browser) {
+}
+
+MediaRouterActionPlatformDelegateViews::
+ ~MediaRouterActionPlatformDelegateViews() {
+}
+
+void MediaRouterActionPlatformDelegateViews::CloseOverflowMenuIfOpen() {
+ if (!browser_)
+ return;
+
+ ToolbarView* toolbar =
+ BrowserView::GetBrowserViewForBrowser(browser_)->toolbar();
+ if (toolbar->IsWrenchMenuShowing())
+ toolbar->CloseAppMenu();
+}

Powered by Google App Engine
This is Rietveld 408576698