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

Side by Side Diff: ash/common/shelf/overflow_button.cc

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: const -> constexpr Created 4 years 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 | « ash/common/shelf/app_list_button.cc ('k') | ash/common/system/tray/tray_background_view.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 "ash/common/shelf/overflow_button.h" 5 #include "ash/common/shelf/overflow_button.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/shelf/ink_drop_button_listener.h" 9 #include "ash/common/shelf/ink_drop_button_listener.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::unique_ptr<views::InkDrop> OverflowButton::CreateInkDrop() { 87 std::unique_ptr<views::InkDrop> OverflowButton::CreateInkDrop() {
88 std::unique_ptr<views::InkDropImpl> ink_drop = 88 std::unique_ptr<views::InkDropImpl> ink_drop =
89 CreateDefaultFloodFillInkDropImpl(); 89 CreateDefaultFloodFillInkDropImpl();
90 ink_drop->SetShowHighlightOnHover(false); 90 ink_drop->SetShowHighlightOnHover(false);
91 ink_drop->SetAutoHighlightMode(views::InkDropImpl::AutoHighlightMode::NONE); 91 ink_drop->SetAutoHighlightMode(views::InkDropImpl::AutoHighlightMode::NONE);
92 return std::move(ink_drop); 92 return std::move(ink_drop);
93 } 93 }
94 94
95 std::unique_ptr<views::InkDropRipple> OverflowButton::CreateInkDropRipple() 95 std::unique_ptr<views::InkDropRipple> OverflowButton::CreateInkDropRipple()
96 const { 96 const {
97 gfx::Insets insets = GetLocalBounds().InsetsFrom(CalculateButtonBounds());
97 return base::MakeUnique<views::FloodFillInkDropRipple>( 98 return base::MakeUnique<views::FloodFillInkDropRipple>(
98 CalculateButtonBounds(), GetInkDropCenterBasedOnLastEvent(), 99 size(), insets, GetInkDropCenterBasedOnLastEvent(), GetInkDropBaseColor(),
99 GetInkDropBaseColor(), ink_drop_visible_opacity()); 100 ink_drop_visible_opacity());
100 } 101 }
101 102
102 bool OverflowButton::ShouldEnterPushedState(const ui::Event& event) { 103 bool OverflowButton::ShouldEnterPushedState(const ui::Event& event) {
103 if (shelf_view_->IsShowingOverflowBubble()) 104 if (shelf_view_->IsShowingOverflowBubble())
104 return false; 105 return false;
105 106
106 return CustomButton::ShouldEnterPushedState(event); 107 return CustomButton::ShouldEnterPushedState(event);
107 } 108 }
108 109
109 void OverflowButton::NotifyClick(const ui::Event& event) { 110 void OverflowButton::NotifyClick(const ui::Event& event) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 bounds = 202 bounds =
202 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, 203 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2,
203 bounds.y() + kShelfItemInset, background->width(), 204 bounds.y() + kShelfItemInset, background->width(),
204 background->height()); 205 background->height());
205 } 206 }
206 } 207 }
207 return bounds; 208 return bounds;
208 } 209 }
209 210
210 } // namespace ash 211 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/system/tray/tray_background_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698