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

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

Issue 1534303002: CustomButton cleanup: make protected members private, create accessors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dont move declaration randomly Created 4 years, 11 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 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/shelf/overflow_button.h" 5 #include "ash/shelf/overflow_button.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_widget.h" 9 #include "ash/shelf/shelf_widget.h"
10 #include "grit/ash_resources.h" 10 #include "grit/ash_resources.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 } else { 65 } else {
66 rect.set_origin(gfx::Point( 66 rect.set_origin(gfx::Point(
67 bounds.x() + kBackgroundOffset - 1, 67 bounds.x() + kBackgroundOffset - 1,
68 bounds.y() + ((bounds.height() - kButtonHoverSize) / 2) - 1)); 68 bounds.y() + ((bounds.height() - kButtonHoverSize) / 2) - 1));
69 } 69 }
70 70
71 SkPaint paint; 71 SkPaint paint;
72 paint.setAntiAlias(true); 72 paint.setAntiAlias(true);
73 paint.setStyle(SkPaint::kFill_Style); 73 paint.setStyle(SkPaint::kFill_Style);
74 paint.setColor(SkColorSetARGB( 74 paint.setColor(
75 kButtonHoverAlpha * hover_animation_->GetCurrentValue(), 75 SkColorSetA(SK_ColorBLACK,
76 0, 0, 0)); 76 hover_animation().CurrentValueBetween(0, kButtonHoverAlpha)));
77 77
78 const SkScalar radius = SkIntToScalar(kButtonCornerRadius); 78 const SkScalar radius = SkIntToScalar(kButtonCornerRadius);
79 SkPath path; 79 SkPath path;
80 path.addRoundRect(gfx::RectToSkRect(rect), radius, radius); 80 path.addRoundRect(gfx::RectToSkRect(rect), radius, radius);
81 canvas->DrawPath(path, paint); 81 canvas->DrawPath(path, paint);
82 } 82 }
83 83
84 void OverflowButton::OnPaint(gfx::Canvas* canvas) { 84 void OverflowButton::OnPaint(gfx::Canvas* canvas) {
85 ShelfLayoutManager* layout_manager = 85 ShelfLayoutManager* layout_manager =
86 ShelfLayoutManager::ForShelf(GetWidget()->GetNativeView()); 86 ShelfLayoutManager::ForShelf(GetWidget()->GetNativeView());
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 image = bottom_image_; 141 image = bottom_image_;
142 break; 142 break;
143 } 143 }
144 144
145 canvas->DrawImageInt(*image, 145 canvas->DrawImageInt(*image,
146 bounds.x() + ((bounds.width() - image->width()) / 2), 146 bounds.x() + ((bounds.width() - image->width()) / 2),
147 bounds.y() + ((bounds.height() - image->height()) / 2)); 147 bounds.y() + ((bounds.height() - image->height()) / 2));
148 } 148 }
149 149
150 } // namespace ash 150 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/caption_buttons/frame_caption_button.cc ('k') | chrome/browser/ui/views/tabs/media_indicator_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698