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

Side by Side Diff: ui/views/examples/native_theme_button_example.cc

Issue 9021046: Pass const gfx::Rect& as the first parameter to FillRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: one more fix Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/views/examples/native_theme_button_example.h" 5 #include "ui/views/examples/native_theme_button_example.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return gfx::NativeTheme::kHovered; 186 return gfx::NativeTheme::kHovered;
187 } 187 }
188 188
189 gfx::Size ExampleNativeThemeButton::GetPreferredSize() { 189 gfx::Size ExampleNativeThemeButton::GetPreferredSize() {
190 return painter_.get() == NULL ? gfx::Size() : painter_->GetPreferredSize(); 190 return painter_.get() == NULL ? gfx::Size() : painter_->GetPreferredSize();
191 } 191 }
192 192
193 void ExampleNativeThemeButton::OnPaintBackground(gfx::Canvas* canvas) { 193 void ExampleNativeThemeButton::OnPaintBackground(gfx::Canvas* canvas) {
194 // Fill the background with a known colour so that we know where the bounds 194 // Fill the background with a known colour so that we know where the bounds
195 // of the View are. 195 // of the View are.
196 canvas->FillRect(SkColorSetRGB(255, 128, 128), GetLocalBounds()); 196 canvas->FillRect(GetLocalBounds(), SkColorSetRGB(255, 128, 128));
197 CustomButton::OnPaintBackground(canvas); 197 CustomButton::OnPaintBackground(canvas);
198 } 198 }
199 199
200 //////////////////////////////////////////////////////////////////////////////// 200 ////////////////////////////////////////////////////////////////////////////////
201 201
202 NativeThemeButtonExample::NativeThemeButtonExample() 202 NativeThemeButtonExample::NativeThemeButtonExample()
203 : ExampleBase("Native Theme Button") { 203 : ExampleBase("Native Theme Button") {
204 } 204 }
205 205
206 NativeThemeButtonExample::~NativeThemeButtonExample() { 206 NativeThemeButtonExample::~NativeThemeButtonExample() {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 layout->AddPaddingRow(0, 8); 249 layout->AddPaddingRow(0, 8);
250 } 250 }
251 251
252 void NativeThemeButtonExample::ButtonPressed(Button* sender, 252 void NativeThemeButtonExample::ButtonPressed(Button* sender,
253 const Event& event) { 253 const Event& event) {
254 PrintStatus(button_->MessWithState().c_str()); 254 PrintStatus(button_->MessWithState().c_str());
255 } 255 }
256 256
257 } // namespace examples 257 } // namespace examples
258 } // namespace views 258 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/tree/tree_view_views.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698