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

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: 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..8f57f747a3ae534e1afbd0747243c57671f5c229
--- /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) {
Devlin 2015/07/14 17:23:02 indentation off.
apacible 2015/07/14 21:15:23 Done.
+}
+
+MediaRouterActionPlatformDelegateViews::
+ ~MediaRouterActionPlatformDelegateViews() {
+}
+
+void MediaRouterActionPlatformDelegateViews::CloseOverflowMenu() {
+ if (!browser_)
Devlin 2015/07/14 17:23:02 When can this be null?
apacible 2015/07/14 21:15:23 Hopefully never, but I added the check just in cas
Devlin 2015/07/14 21:31:07 When the answer is "never", it's always best to *n
apacible 2015/07/16 16:52:11 Thanks, done.
+ return;
+
+ ToolbarView* toolbar =
+ BrowserView::GetBrowserViewForBrowser(browser_)->toolbar();
+ if (toolbar->IsWrenchMenuShowing())
+ toolbar->CloseAppMenu();
+}

Powered by Google App Engine
This is Rietveld 408576698