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

Side by Side Diff: chrome/browser/ui/views/profiles/avatar_menu_button.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/profiles/avatar_menu_button.h" 5 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 29 matching lines...) Expand all
40 AvatarMenuButton::AvatarMenuButton(BrowserView* browser_view) 40 AvatarMenuButton::AvatarMenuButton(BrowserView* browser_view)
41 : MenuButton(base::string16(), this, false), 41 : MenuButton(base::string16(), this, false),
42 browser_view_(browser_view), 42 browser_view_(browser_view),
43 enabled_(browser_view_->IsRegularOrGuestSession()), 43 enabled_(browser_view_->IsRegularOrGuestSession()),
44 is_rectangle_(false), 44 is_rectangle_(false),
45 old_height_(0) { 45 old_height_(0) {
46 // In RTL mode, the avatar icon should be looking the opposite direction. 46 // In RTL mode, the avatar icon should be looking the opposite direction.
47 EnableCanvasFlippingForRTLUI(true); 47 EnableCanvasFlippingForRTLUI(true);
48 48
49 SetEventTargeter( 49 SetEventTargeter(
50 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); 50 std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
51 } 51 }
52 52
53 AvatarMenuButton::~AvatarMenuButton() { 53 AvatarMenuButton::~AvatarMenuButton() {
54 } 54 }
55 55
56 const char* AvatarMenuButton::GetClassName() const { 56 const char* AvatarMenuButton::GetClassName() const {
57 return kViewClassName; 57 return kViewClassName;
58 } 58 }
59 59
60 void AvatarMenuButton::OnPaint(gfx::Canvas* canvas) { 60 void AvatarMenuButton::OnPaint(gfx::Canvas* canvas) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 views::ViewTargeterDelegate::DoesIntersectRect(target, rect); 150 views::ViewTargeterDelegate::DoesIntersectRect(target, rect);
151 } 151 }
152 152
153 // views::MenuButtonListener implementation 153 // views::MenuButtonListener implementation
154 void AvatarMenuButton::OnMenuButtonClicked(views::MenuButton* source, 154 void AvatarMenuButton::OnMenuButtonClicked(views::MenuButton* source,
155 const gfx::Point& point, 155 const gfx::Point& point,
156 const ui::Event* event) { 156 const ui::Event* event) {
157 if (enabled_) 157 if (enabled_)
158 chrome::ShowAvatarMenu(browser_view_->browser()); 158 chrome::ShowAvatarMenu(browser_view_->browser());
159 } 159 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/avatar_menu_button.h ('k') | chrome/browser/ui/views/profiles/new_avatar_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698