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

Side by Side Diff: ui/views/touchui/touch_selection_controller_impl.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
« no previous file with comments | « ui/views/examples/native_theme_button_example.cc ('k') | ui/views/window/dialog_client_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 (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/touchui/touch_selection_controller_impl.h" 5 #include "ui/views/touchui/touch_selection_controller_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "third_party/skia/include/effects/SkGradientShader.h" 10 #include "third_party/skia/include/effects/SkGradientShader.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 SkColor background_color, border_color; 184 SkColor background_color, border_color;
185 if (state == CustomButton::BS_NORMAL) { 185 if (state == CustomButton::BS_NORMAL) {
186 background_color = SkColorSetARGB(102, 255, 255, 255); 186 background_color = SkColorSetARGB(102, 255, 255, 255);
187 border_color = SkColorSetARGB(36, 0, 0, 0); 187 border_color = SkColorSetARGB(36, 0, 0, 0);
188 } else { 188 } else {
189 background_color = SkColorSetARGB(13, 0, 0, 0); 189 background_color = SkColorSetARGB(13, 0, 0, 0);
190 border_color = SkColorSetARGB(72, 0, 0, 0); 190 border_color = SkColorSetARGB(72, 0, 0, 0);
191 } 191 }
192 int w = view->width(); 192 int w = view->width();
193 int h = view->height(); 193 int h = view->height();
194 canvas->FillRect(background_color, gfx::Rect(1, 1, w - 2, h - 2)); 194 canvas->FillRect(gfx::Rect(1, 1, w - 2, h - 2), background_color);
195 canvas->FillRect(border_color, gfx::Rect(2, 0, w - 4, 1)); 195 canvas->FillRect(gfx::Rect(2, 0, w - 4, 1), border_color);
196 canvas->FillRect(border_color, gfx::Rect(1, 1, 1, 1)); 196 canvas->FillRect(gfx::Rect(1, 1, 1, 1), border_color);
197 canvas->FillRect(border_color, gfx::Rect(0, 2, 1, h - 4)); 197 canvas->FillRect(gfx::Rect(0, 2, 1, h - 4), border_color);
198 canvas->FillRect(border_color, gfx::Rect(1, h - 2, 1, 1)); 198 canvas->FillRect(gfx::Rect(1, h - 2, 1, 1), border_color);
199 canvas->FillRect(border_color, gfx::Rect(2, h - 1, w - 4, 1)); 199 canvas->FillRect(gfx::Rect(2, h - 1, w - 4, 1), border_color);
200 canvas->FillRect(border_color, gfx::Rect(w - 2, 1, 1, 1)); 200 canvas->FillRect(gfx::Rect(w - 2, 1, 1, 1), border_color);
201 canvas->FillRect(border_color, gfx::Rect(w - 1, 2, 1, h - 4)); 201 canvas->FillRect(gfx::Rect(w - 1, 2, 1, h - 4), border_color);
202 canvas->FillRect(border_color, gfx::Rect(w - 2, h - 2, 1, 1)); 202 canvas->FillRect(gfx::Rect(w - 2, h - 2, 1, 1), border_color);
203 } 203 }
204 204
205 private: 205 private:
206 DISALLOW_COPY_AND_ASSIGN(ContextMenuButtonBackground); 206 DISALLOW_COPY_AND_ASSIGN(ContextMenuButtonBackground);
207 }; 207 };
208 208
209 // A View that displays the touch context menu. 209 // A View that displays the touch context menu.
210 class TouchSelectionControllerImpl::TouchContextMenuView 210 class TouchSelectionControllerImpl::TouchContextMenuView
211 : public ButtonListener, 211 : public ButtonListener,
212 public View { 212 public View {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { 499 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() {
500 return selection_handle_2_->visible(); 500 return selection_handle_2_->visible();
501 } 501 }
502 502
503 TouchSelectionController* TouchSelectionController::create( 503 TouchSelectionController* TouchSelectionController::create(
504 TouchSelectionClientView* client_view) { 504 TouchSelectionClientView* client_view) {
505 return new TouchSelectionControllerImpl(client_view); 505 return new TouchSelectionControllerImpl(client_view);
506 } 506 }
507 507
508 } // namespace views 508 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/native_theme_button_example.cc ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698