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

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

Issue 2508063004: Take size in ink drop masks instead of bounds (Closed)
Patch Set: Rebased 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 | ash/common/system/tray/tray_background_view.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/app_list_button.h" 5 #include "ash/common/shelf/app_list_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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 std::unique_ptr<views::InkDrop> AppListButton::CreateInkDrop() { 276 std::unique_ptr<views::InkDrop> AppListButton::CreateInkDrop() {
277 std::unique_ptr<views::InkDropImpl> ink_drop = 277 std::unique_ptr<views::InkDropImpl> ink_drop =
278 CustomButton::CreateDefaultInkDropImpl(); 278 CustomButton::CreateDefaultInkDropImpl();
279 ink_drop->SetShowHighlightOnHover(false); 279 ink_drop->SetShowHighlightOnHover(false);
280 return std::move(ink_drop); 280 return std::move(ink_drop);
281 } 281 }
282 282
283 std::unique_ptr<views::InkDropMask> AppListButton::CreateInkDropMask() const { 283 std::unique_ptr<views::InkDropMask> AppListButton::CreateInkDropMask() const {
284 return base::MakeUnique<views::CircleInkDropMask>( 284 return base::MakeUnique<views::CircleInkDropMask>(size(), GetCenterPoint(),
285 GetLocalBounds(), GetCenterPoint(), kAppListButtonRadius); 285 kAppListButtonRadius);
286 } 286 }
287 287
288 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { 288 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) {
289 if (draw_background_as_active_ == draw_background_as_active) 289 if (draw_background_as_active_ == draw_background_as_active)
290 return; 290 return;
291 draw_background_as_active_ = draw_background_as_active; 291 draw_background_as_active_ = draw_background_as_active;
292 SchedulePaint(); 292 SchedulePaint();
293 } 293 }
294 294
295 gfx::Point AppListButton::GetCenterPoint() const { 295 gfx::Point AppListButton::GetCenterPoint() const {
296 gfx::Point center = GetContentsBounds().CenterPoint(); 296 gfx::Point center = GetContentsBounds().CenterPoint();
297 if (!IsHorizontalAlignment(wm_shelf_->GetAlignment())) 297 if (!IsHorizontalAlignment(wm_shelf_->GetAlignment()))
298 center = gfx::Point(center.y(), center.x()); 298 center = gfx::Point(center.y(), center.x());
299 return center; 299 return center;
300 } 300 }
301 301
302 } // namespace ash 302 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/tray_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698