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

Side by Side Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 9332006: ui/gfx: Make the first version of Canvas::TileImageInt take a gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: put back the Peter's nits 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/find_bar_view.h" 5 #include "chrome/browser/ui/views/find_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void FindBarView::OnPaint(gfx::Canvas* canvas) { 227 void FindBarView::OnPaint(gfx::Canvas* canvas) {
228 // Paint drop down bar border and background. 228 // Paint drop down bar border and background.
229 DropdownBarView::OnPaint(canvas); 229 DropdownBarView::OnPaint(canvas);
230 230
231 // Then we draw the background image for the Find Textfield. We start by 231 // Then we draw the background image for the Find Textfield. We start by
232 // calculating the position of background images for the Find text box. 232 // calculating the position of background images for the Find text box.
233 int find_text_x = find_text_->x(); 233 int find_text_x = find_text_->x();
234 gfx::Point back_button_origin = find_previous_button_->bounds().origin(); 234 gfx::Point back_button_origin = find_previous_button_->bounds().origin();
235 235
236 // Draw the image to the left that creates a curved left edge for the box. 236 // Draw the image to the left that creates a curved left edge for the box.
237 canvas->TileImageInt(*text_box_background_left_, 237 canvas->TileImage(*text_box_background_left_,
238 find_text_x - text_box_background_left_->width(), 238 gfx::Rect(find_text_x - text_box_background_left_->width(),
239 back_button_origin.y(), text_box_background_left_->width(), 239 back_button_origin.y(), text_box_background_left_->width(),
240 text_box_background_left_->height()); 240 text_box_background_left_->height()));
241 241
242 // Draw the top and bottom border for whole text box (encompasses both the 242 // Draw the top and bottom border for whole text box (encompasses both the
243 // find_text_ edit box and the match_count_text_ label). 243 // find_text_ edit box and the match_count_text_ label).
244 canvas->TileImageInt(*text_box_background_, find_text_x, 244 canvas->TileImage(*text_box_background_, gfx::Rect(find_text_x,
245 back_button_origin.y(), 245 back_button_origin.y(), back_button_origin.x() - find_text_x,
246 back_button_origin.x() - find_text_x, 246 text_box_background_->height()));
247 text_box_background_->height());
248 } 247 }
249 248
250 void FindBarView::Layout() { 249 void FindBarView::Layout() {
251 int panel_width = GetPreferredSize().width(); 250 int panel_width = GetPreferredSize().width();
252 251
253 // Stay within view bounds. 252 // Stay within view bounds.
254 int view_width = width(); 253 int view_width = width();
255 if (view_width && view_width < panel_width) 254 if (view_width && view_width < panel_width)
256 panel_width = view_width; 255 panel_width = view_width;
257 256
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 482
484 void FindBarView::OnThemeChanged() { 483 void FindBarView::OnThemeChanged() {
485 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 484 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
486 if (GetThemeProvider()) { 485 if (GetThemeProvider()) {
487 close_button_->SetBackground( 486 close_button_->SetBackground(
488 GetThemeProvider()->GetColor(ThemeService::COLOR_TAB_TEXT), 487 GetThemeProvider()->GetColor(ThemeService::COLOR_TAB_TEXT),
489 rb.GetBitmapNamed(IDR_CLOSE_BAR), 488 rb.GetBitmapNamed(IDR_CLOSE_BAR),
490 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); 489 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK));
491 } 490 }
492 } 491 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/about_chrome_view.cc ('k') | chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698