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

Side by Side Diff: chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_views.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_ views.h" 5 #include "chrome/browser/ui/views/toolbar/media_router_action_platform_delegate_ views.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "chrome/browser/ui/views/frame/browser_view.h" 8 #include "chrome/browser/ui/views/frame/browser_view.h"
8 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" 9 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
9 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 10 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
10 11
11 // static 12 // static
12 scoped_ptr<MediaRouterActionPlatformDelegate> 13 std::unique_ptr<MediaRouterActionPlatformDelegate>
13 MediaRouterActionPlatformDelegate::Create(Browser* browser) { 14 MediaRouterActionPlatformDelegate::Create(Browser* browser) {
14 return make_scoped_ptr(new MediaRouterActionPlatformDelegateViews(browser)); 15 return base::WrapUnique(new MediaRouterActionPlatformDelegateViews(browser));
15 } 16 }
16 17
17 MediaRouterActionPlatformDelegateViews::MediaRouterActionPlatformDelegateViews( 18 MediaRouterActionPlatformDelegateViews::MediaRouterActionPlatformDelegateViews(
18 Browser* browser) 19 Browser* browser)
19 : MediaRouterActionPlatformDelegate(), 20 : MediaRouterActionPlatformDelegate(),
20 browser_(browser) { 21 browser_(browser) {
21 DCHECK(browser_); 22 DCHECK(browser_);
22 } 23 }
23 24
24 MediaRouterActionPlatformDelegateViews:: 25 MediaRouterActionPlatformDelegateViews::
25 ~MediaRouterActionPlatformDelegateViews() { 26 ~MediaRouterActionPlatformDelegateViews() {
26 } 27 }
27 28
28 bool MediaRouterActionPlatformDelegateViews::CloseOverflowMenuIfOpen() { 29 bool MediaRouterActionPlatformDelegateViews::CloseOverflowMenuIfOpen() {
29 AppMenuButton* app_menu_button = 30 AppMenuButton* app_menu_button =
30 BrowserView::GetBrowserViewForBrowser(browser_) 31 BrowserView::GetBrowserViewForBrowser(browser_)
31 ->toolbar() 32 ->toolbar()
32 ->app_menu_button(); 33 ->app_menu_button();
33 if (!app_menu_button->IsMenuShowing()) 34 if (!app_menu_button->IsMenuShowing())
34 return false; 35 return false;
35 36
36 app_menu_button->CloseMenu(); 37 app_menu_button->CloseMenu();
37 return true; 38 return true;
38 } 39 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/chevron_menu_button.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_action_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698