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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 2094343005: Fix MD button hover shadow effect on odd-sized buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bookmarks/bookmark_bar_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 GetInkDropBaseColor(), ink_drop_visible_opacity())); 246 GetInkDropBaseColor(), ink_drop_visible_opacity()));
247 } 247 }
248 248
249 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() 249 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
250 const override { 250 const override {
251 if (!ShouldShowInkDropHighlight()) 251 if (!ShouldShowInkDropHighlight())
252 return nullptr; 252 return nullptr;
253 253
254 const gfx::Rect bounds = CalculateInkDropBounds(size()); 254 const gfx::Rect bounds = CalculateInkDropBounds(size());
255 return base::WrapUnique(new views::InkDropHighlight( 255 return base::WrapUnique(new views::InkDropHighlight(
256 bounds.size(), 0, bounds.CenterPoint(), GetInkDropBaseColor())); 256 bounds.size(), 0, gfx::RectF(bounds).CenterPoint(),
257 GetInkDropBaseColor()));
257 } 258 }
258 259
259 SkColor GetInkDropBaseColor() const override { 260 SkColor GetInkDropBaseColor() const override {
260 return GetThemeProvider()->GetColor( 261 return GetThemeProvider()->GetColor(
261 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); 262 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
262 } 263 }
263 264
264 private: 265 private:
265 std::unique_ptr<gfx::SlideAnimation> show_animation_; 266 std::unique_ptr<gfx::SlideAnimation> show_animation_;
266 267
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 GetInkDropBaseColor(), ink_drop_visible_opacity())); 346 GetInkDropBaseColor(), ink_drop_visible_opacity()));
346 } 347 }
347 348
348 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() 349 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
349 const override { 350 const override {
350 if (!ShouldShowInkDropHighlight()) 351 if (!ShouldShowInkDropHighlight())
351 return nullptr; 352 return nullptr;
352 353
353 const gfx::Rect bounds = CalculateInkDropBounds(size()); 354 const gfx::Rect bounds = CalculateInkDropBounds(size());
354 return base::WrapUnique(new views::InkDropHighlight( 355 return base::WrapUnique(new views::InkDropHighlight(
355 bounds.size(), 0, bounds.CenterPoint(), GetInkDropBaseColor())); 356 bounds.size(), 0, gfx::RectF(bounds).CenterPoint(),
357 GetInkDropBaseColor()));
356 } 358 }
357 359
358 SkColor GetInkDropBaseColor() const override { 360 SkColor GetInkDropBaseColor() const override {
359 return GetThemeProvider()->GetColor( 361 return GetThemeProvider()->GetColor(
360 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); 362 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
361 } 363 }
362 364
363 private: 365 private:
364 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuButtonBase); 366 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuButtonBase);
365 }; 367 };
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 return; 2161 return;
2160 apps_page_shortcut_->SetVisible(visible); 2162 apps_page_shortcut_->SetVisible(visible);
2161 UpdateBookmarksSeparatorVisibility(); 2163 UpdateBookmarksSeparatorVisibility();
2162 LayoutAndPaint(); 2164 LayoutAndPaint();
2163 } 2165 }
2164 2166
2165 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2167 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2166 if (UpdateOtherAndManagedButtonsVisibility()) 2168 if (UpdateOtherAndManagedButtonsVisibility())
2167 LayoutAndPaint(); 2169 LayoutAndPaint();
2168 } 2170 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_item_view_md.cc » ('j') | ui/views/animation/ink_drop_highlight.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698