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

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

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 // Base class for non-menu hosting buttons used on the bookmark bar. 200 // Base class for non-menu hosting buttons used on the bookmark bar.
201 201
202 class BookmarkButtonBase : public views::LabelButton { 202 class BookmarkButtonBase : public views::LabelButton {
203 public: 203 public:
204 BookmarkButtonBase(views::ButtonListener* listener, 204 BookmarkButtonBase(views::ButtonListener* listener,
205 const base::string16& title) 205 const base::string16& title)
206 : LabelButton(listener, title) { 206 : LabelButton(listener, title) {
207 SetElideBehavior(kElideBehavior); 207 SetElideBehavior(kElideBehavior);
208 if (ui::MaterialDesignController::IsModeMaterial()) { 208 if (ui::MaterialDesignController::IsModeMaterial()) {
209 SetHasInkDrop(true); 209 SetInkDropMode(InkDropMode::ON);
210 set_has_ink_drop_action_on_click(true); 210 set_has_ink_drop_action_on_click(true);
211 SetFocusPainter(nullptr); 211 SetFocusPainter(nullptr);
212 } 212 }
213 show_animation_.reset(new gfx::SlideAnimation(this)); 213 show_animation_.reset(new gfx::SlideAnimation(this));
214 if (!animations_enabled) { 214 if (!animations_enabled) {
215 // For some reason during testing the events generated by animating 215 // For some reason during testing the events generated by animating
216 // throw off the test. So, don't animate while testing. 216 // throw off the test. So, don't animate while testing.
217 show_animation_->Reset(1); 217 show_animation_->Reset(1);
218 } else { 218 } else {
219 show_animation_->Show(); 219 show_animation_->Show();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 // BookmarkMenuButtonBase ----------------------------------------------------- 329 // BookmarkMenuButtonBase -----------------------------------------------------
330 330
331 // Base class for menu hosting buttons used on the bookmark bar. 331 // Base class for menu hosting buttons used on the bookmark bar.
332 class BookmarkMenuButtonBase : public views::MenuButton { 332 class BookmarkMenuButtonBase : public views::MenuButton {
333 public: 333 public:
334 BookmarkMenuButtonBase(const base::string16& title, 334 BookmarkMenuButtonBase(const base::string16& title,
335 views::MenuButtonListener* menu_button_listener, 335 views::MenuButtonListener* menu_button_listener,
336 bool show_menu_marker) 336 bool show_menu_marker)
337 : MenuButton(title, menu_button_listener, show_menu_marker) { 337 : MenuButton(title, menu_button_listener, show_menu_marker) {
338 SetHasInkDrop(ui::MaterialDesignController::IsModeMaterial()); 338 if (ui::MaterialDesignController::IsModeMaterial()) {
339 if (ui::MaterialDesignController::IsModeMaterial()) 339 SetInkDropMode(InkDropMode::ON);
340 SetFocusPainter(nullptr); 340 SetFocusPainter(nullptr);
341 }
341 } 342 }
342 343
343 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { 344 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override {
344 return base::WrapUnique(new views::FloodFillInkDropRipple( 345 return base::WrapUnique(new views::FloodFillInkDropRipple(
345 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), 346 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(),
346 GetInkDropBaseColor(), ink_drop_visible_opacity())); 347 GetInkDropBaseColor(), ink_drop_visible_opacity()));
347 } 348 }
348 349
349 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() 350 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
350 const override { 351 const override {
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 return; 2162 return;
2162 apps_page_shortcut_->SetVisible(visible); 2163 apps_page_shortcut_->SetVisible(visible);
2163 UpdateBookmarksSeparatorVisibility(); 2164 UpdateBookmarksSeparatorVisibility();
2164 LayoutAndPaint(); 2165 LayoutAndPaint();
2165 } 2166 }
2166 2167
2167 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2168 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2168 if (UpdateOtherAndManagedButtonsVisibility()) 2169 if (UpdateOtherAndManagedButtonsVisibility())
2169 LayoutAndPaint(); 2170 LayoutAndPaint();
2170 } 2171 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bar_control_button.cc ('k') | chrome/browser/ui/views/download/download_item_view_md.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698