| OLD | NEW |
| 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 "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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 void FindBarView::OnPaint(gfx::Canvas* canvas) { | 222 void FindBarView::OnPaint(gfx::Canvas* canvas) { |
| 223 SkPaint paint; | 223 SkPaint paint; |
| 224 | 224 |
| 225 gfx::Rect bounds = PaintOffsetToolbarBackground(canvas); | 225 gfx::Rect bounds = PaintOffsetToolbarBackground(canvas); |
| 226 | 226 |
| 227 // Now flip the canvas for the rest of the graphics if in RTL mode. | 227 // Now flip the canvas for the rest of the graphics if in RTL mode. |
| 228 canvas->Save(); | 228 canvas->Save(); |
| 229 if (base::i18n::IsRTL()) { | 229 if (base::i18n::IsRTL()) { |
| 230 canvas->Translate(gfx::Point(width(), 0)); | 230 canvas->Translate(gfx::Point(width(), 0)); |
| 231 canvas->ScaleInt(-1, 1); | 231 canvas->Scale(-1, 1); |
| 232 } | 232 } |
| 233 | 233 |
| 234 PaintDialogBorder(canvas, bounds); | 234 PaintDialogBorder(canvas, bounds); |
| 235 | 235 |
| 236 // Then we draw the background image for the Find Textfield. We start by | 236 // Then we draw the background image for the Find Textfield. We start by |
| 237 // calculating the position of background images for the Find text box. | 237 // calculating the position of background images for the Find text box. |
| 238 int find_text_x = find_text_->x(); | 238 int find_text_x = find_text_->x(); |
| 239 gfx::Point back_button_origin = find_previous_button_->bounds().origin(); | 239 gfx::Point back_button_origin = find_previous_button_->bounds().origin(); |
| 240 | 240 |
| 241 // Draw the image to the left that creates a curved left edge for the box. | 241 // Draw the image to the left that creates a curved left edge for the box. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 489 |
| 490 void FindBarView::OnThemeChanged() { | 490 void FindBarView::OnThemeChanged() { |
| 491 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 491 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 492 if (GetThemeProvider()) { | 492 if (GetThemeProvider()) { |
| 493 close_button_->SetBackground( | 493 close_button_->SetBackground( |
| 494 GetThemeProvider()->GetColor(ThemeService::COLOR_TAB_TEXT), | 494 GetThemeProvider()->GetColor(ThemeService::COLOR_TAB_TEXT), |
| 495 rb.GetBitmapNamed(IDR_CLOSE_BAR), | 495 rb.GetBitmapNamed(IDR_CLOSE_BAR), |
| 496 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); | 496 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); |
| 497 } | 497 } |
| 498 } | 498 } |
| OLD | NEW |