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

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

Issue 2679423002: ash: Clean up naming of paint-related identifiers (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/shelf/shelf_button.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 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 std::unique_ptr<views::InkDropMask> OverflowButton::CreateInkDropMask() const { 113 std::unique_ptr<views::InkDropMask> OverflowButton::CreateInkDropMask() const {
114 gfx::Insets insets = GetLocalBounds().InsetsFrom(CalculateButtonBounds()); 114 gfx::Insets insets = GetLocalBounds().InsetsFrom(CalculateButtonBounds());
115 return base::MakeUnique<views::RoundRectInkDropMask>( 115 return base::MakeUnique<views::RoundRectInkDropMask>(
116 size(), insets, kOverflowButtonCornerRadius); 116 size(), insets, kOverflowButtonCornerRadius);
117 } 117 }
118 118
119 void OverflowButton::PaintBackground(gfx::Canvas* canvas, 119 void OverflowButton::PaintBackground(gfx::Canvas* canvas,
120 const gfx::Rect& bounds) { 120 const gfx::Rect& bounds) {
121 if (MaterialDesignController::IsShelfMaterial()) { 121 if (MaterialDesignController::IsShelfMaterial()) {
122 cc::PaintFlags background_paint; 122 cc::PaintFlags flags;
123 background_paint.setFlags(cc::PaintFlags::kAntiAlias_Flag); 123 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag);
124 background_paint.setColor(SkColorSetA(kShelfBaseColor, background_alpha_)); 124 flags.setColor(SkColorSetA(kShelfBaseColor, background_alpha_));
125 canvas->DrawRoundRect(bounds, kOverflowButtonCornerRadius, 125 canvas->DrawRoundRect(bounds, kOverflowButtonCornerRadius, flags);
126 background_paint);
127 } else { 126 } else {
128 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 127 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
129 const gfx::ImageSkia* background = 128 const gfx::ImageSkia* background =
130 rb.GetImageNamed(NonMaterialBackgroundImageId()).ToImageSkia(); 129 rb.GetImageNamed(NonMaterialBackgroundImageId()).ToImageSkia();
131 canvas->DrawImageInt(*background, bounds.x(), bounds.y()); 130 canvas->DrawImageInt(*background, bounds.x(), bounds.y());
132 } 131 }
133 } 132 }
134 133
135 void OverflowButton::PaintForeground(gfx::Canvas* canvas, 134 void OverflowButton::PaintForeground(gfx::Canvas* canvas,
136 const gfx::Rect& bounds) { 135 const gfx::Rect& bounds) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 bounds = 196 bounds =
198 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, 197 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2,
199 bounds.y() + kShelfItemInset, background->width(), 198 bounds.y() + kShelfItemInset, background->width(),
200 background->height()); 199 background->height());
201 } 200 }
202 } 201 }
203 return bounds; 202 return bounds;
204 } 203 }
205 204
206 } // namespace ash 205 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/shelf/shelf_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698