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

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

Issue 2508243002: Enabled ink drop highlight for focus on bookmark bar buttons. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 bool IsTriggerableEvent(const ui::Event& e) override { 212 bool IsTriggerableEvent(const ui::Event& e) override {
213 return e.type() == ui::ET_GESTURE_TAP || 213 return e.type() == ui::ET_GESTURE_TAP ||
214 e.type() == ui::ET_GESTURE_TAP_DOWN || 214 e.type() == ui::ET_GESTURE_TAP_DOWN ||
215 event_utils::IsPossibleDispositionEvent(e); 215 event_utils::IsPossibleDispositionEvent(e);
216 } 216 }
217 217
218 // LabelButton: 218 // LabelButton:
219 std::unique_ptr<views::InkDrop> CreateInkDrop() override { 219 std::unique_ptr<views::InkDrop> CreateInkDrop() override {
220 return CreateDefaultFloodFillInkDropImpl(); 220 std::unique_ptr<views::InkDropImpl> ink_drop =
221 CreateDefaultFloodFillInkDropImpl();
222 ink_drop->SetShowHighlightOnFocus(true);
Peter Kasting 2016/11/17 19:31:57 Should CreateDefaultFloodFillInkDropImpl() do this
bruthig 2016/11/17 19:43:33 At a high level there is a lot of rework opportuni
223 return std::move(ink_drop);
221 } 224 }
222 225
223 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { 226 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override {
224 return base::MakeUnique<views::FloodFillInkDropRipple>( 227 return base::MakeUnique<views::FloodFillInkDropRipple>(
225 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), 228 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(),
226 GetInkDropBaseColor(), ink_drop_visible_opacity()); 229 GetInkDropBaseColor(), ink_drop_visible_opacity());
227 } 230 }
228 231
229 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() 232 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
230 const override { 233 const override {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 BookmarkMenuButtonBase(const base::string16& title, 333 BookmarkMenuButtonBase(const base::string16& title,
331 views::MenuButtonListener* menu_button_listener, 334 views::MenuButtonListener* menu_button_listener,
332 bool show_menu_marker) 335 bool show_menu_marker)
333 : MenuButton(title, menu_button_listener, show_menu_marker) { 336 : MenuButton(title, menu_button_listener, show_menu_marker) {
334 SetInkDropMode(InkDropMode::ON); 337 SetInkDropMode(InkDropMode::ON);
335 SetFocusPainter(nullptr); 338 SetFocusPainter(nullptr);
336 } 339 }
337 340
338 // MenuButton: 341 // MenuButton:
339 std::unique_ptr<views::InkDrop> CreateInkDrop() override { 342 std::unique_ptr<views::InkDrop> CreateInkDrop() override {
340 return CreateDefaultFloodFillInkDropImpl(); 343 std::unique_ptr<views::InkDropImpl> ink_drop =
344 CreateDefaultFloodFillInkDropImpl();
345 ink_drop->SetShowHighlightOnFocus(true);
346 return std::move(ink_drop);
341 } 347 }
342 348
343 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { 349 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override {
344 return base::MakeUnique<views::FloodFillInkDropRipple>( 350 return base::MakeUnique<views::FloodFillInkDropRipple>(
345 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), 351 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(),
346 GetInkDropBaseColor(), ink_drop_visible_opacity()); 352 GetInkDropBaseColor(), ink_drop_visible_opacity());
347 } 353 }
348 354
349 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() 355 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
350 const override { 356 const override {
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 return; 2141 return;
2136 apps_page_shortcut_->SetVisible(visible); 2142 apps_page_shortcut_->SetVisible(visible);
2137 UpdateBookmarksSeparatorVisibility(); 2143 UpdateBookmarksSeparatorVisibility();
2138 LayoutAndPaint(); 2144 LayoutAndPaint();
2139 } 2145 }
2140 2146
2141 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2147 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2142 if (UpdateOtherAndManagedButtonsVisibility()) 2148 if (UpdateOtherAndManagedButtonsVisibility())
2143 LayoutAndPaint(); 2149 LayoutAndPaint();
2144 } 2150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698