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

Side by Side Diff: chrome/browser/ui/views/toolbar/app_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_menu_button.h" 5 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 const int inset = LabelButton::kFocusRectInset; 166 const int inset = LabelButton::kFocusRectInset;
167 SetFocusPainter(views::Painter::CreateDashedFocusPainterWithInsets( 167 SetFocusPainter(views::Painter::CreateDashedFocusPainterWithInsets(
168 gfx::Insets(inset, inset, inset, inset + margin))); 168 gfx::Insets(inset, inset, inset, inset + margin)));
169 InvalidateLayout(); 169 InvalidateLayout();
170 } 170 }
171 171
172 const char* AppMenuButton::GetClassName() const { 172 const char* AppMenuButton::GetClassName() const {
173 return "AppMenuButton"; 173 return "AppMenuButton";
174 } 174 }
175 175
176 scoped_ptr<views::LabelButtonBorder> AppMenuButton::CreateDefaultBorder() 176 std::unique_ptr<views::LabelButtonBorder> AppMenuButton::CreateDefaultBorder()
177 const { 177 const {
178 scoped_ptr<views::LabelButtonBorder> border = 178 std::unique_ptr<views::LabelButtonBorder> border =
179 MenuButton::CreateDefaultBorder(); 179 MenuButton::CreateDefaultBorder();
180 180
181 // Adjust border insets to follow the margin change, 181 // Adjust border insets to follow the margin change,
182 // which will be reflected in where the border is painted 182 // which will be reflected in where the border is painted
183 // through GetThemePaintRect(). 183 // through GetThemePaintRect().
184 gfx::Insets insets(border->GetInsets()); 184 gfx::Insets insets(border->GetInsets());
185 insets += gfx::Insets(0, 0, 0, margin_trailing_); 185 insets += gfx::Insets(0, 0, 0, margin_trailing_);
186 border->set_insets(insets); 186 border->set_insets(insets);
187 187
188 return border; 188 return border;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 views::MenuButton::OnPaint(canvas); 247 views::MenuButton::OnPaint(canvas);
248 if (ui::MaterialDesignController::IsModeMaterial()) 248 if (ui::MaterialDesignController::IsModeMaterial())
249 return; 249 return;
250 // Use GetPreferredSize() to center the icon inside the visible bounds rather 250 // Use GetPreferredSize() to center the icon inside the visible bounds rather
251 // than the whole size() (which may refer to hit test region extended to the 251 // than the whole size() (which may refer to hit test region extended to the
252 // end of the toolbar in maximized mode). 252 // end of the toolbar in maximized mode).
253 icon_painter_->Paint(canvas, GetThemeProvider(), 253 icon_painter_->Paint(canvas, GetThemeProvider(),
254 gfx::Rect(GetPreferredSize()), 254 gfx::Rect(GetPreferredSize()),
255 AppMenuIconPainter::BEZEL_NONE); 255 AppMenuIconPainter::BEZEL_NONE);
256 } 256 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.h ('k') | chrome/browser/ui/views/toolbar/back_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698