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

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

Issue 1750403005: [MD] some tweaks to download shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view_md.cc ('k') | ui/gfx/geometry/insets.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 UpdateThemedBorder(); 183 UpdateThemedBorder();
184 184
185 const int inset = LabelButton::kFocusRectInset; 185 const int inset = LabelButton::kFocusRectInset;
186 SetFocusPainter(views::Painter::CreateDashedFocusPainterWithInsets( 186 SetFocusPainter(views::Painter::CreateDashedFocusPainterWithInsets(
187 gfx::Insets(inset, inset, inset, inset + margin))); 187 gfx::Insets(inset, inset, inset, inset + margin)));
188 InvalidateLayout(); 188 InvalidateLayout();
189 } 189 }
190 190
191 gfx::Point AppMenuButton::GetInkDropCenter() const { 191 gfx::Point AppMenuButton::GetInkDropCenter() const {
192 // ToolbarView extends the bounds of the app button to the right in maximized 192 // ToolbarView extends the bounds of the app button to the right in maximized
193 // mode. So instead of using the center point of local bounds, we use the 193 // mode.
194 // center point (adjusted for RTL layouts) of the preferred size, which 194 return image()->bounds().CenterPoint();
varkha 2016/03/03 04:39:10 This seems wrong. I am running with --lang=he in c
195 // doesn't change in maximized mode.
196 const int visible_width = GetPreferredSize().width();
197 return gfx::Point(
198 (GetMirroredXWithWidthInView(0, visible_width) + visible_width) / 2,
199 height() / 2);
200 } 195 }
201 196
202 const char* AppMenuButton::GetClassName() const { 197 const char* AppMenuButton::GetClassName() const {
203 return "AppMenuButton"; 198 return "AppMenuButton";
204 } 199 }
205 200
206 scoped_ptr<views::LabelButtonBorder> AppMenuButton::CreateDefaultBorder() 201 scoped_ptr<views::LabelButtonBorder> AppMenuButton::CreateDefaultBorder()
207 const { 202 const {
208 scoped_ptr<views::LabelButtonBorder> border = 203 scoped_ptr<views::LabelButtonBorder> border =
209 MenuButton::CreateDefaultBorder(); 204 MenuButton::CreateDefaultBorder();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 views::MenuButton::OnPaint(canvas); 272 views::MenuButton::OnPaint(canvas);
278 if (ui::MaterialDesignController::IsModeMaterial()) 273 if (ui::MaterialDesignController::IsModeMaterial())
279 return; 274 return;
280 // Use GetPreferredSize() to center the icon inside the visible bounds rather 275 // Use GetPreferredSize() to center the icon inside the visible bounds rather
281 // than the whole size() (which may refer to hit test region extended to the 276 // than the whole size() (which may refer to hit test region extended to the
282 // end of the toolbar in maximized mode). 277 // end of the toolbar in maximized mode).
283 icon_painter_->Paint(canvas, GetThemeProvider(), 278 icon_painter_->Paint(canvas, GetThemeProvider(),
284 gfx::Rect(GetPreferredSize()), 279 gfx::Rect(GetPreferredSize()),
285 AppMenuIconPainter::BEZEL_NONE); 280 AppMenuIconPainter::BEZEL_NONE);
286 } 281 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view_md.cc ('k') | ui/gfx/geometry/insets.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698