| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/views/find_bar_view.h" | 5 #include "chrome/browser/views/find_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gfx/chrome_canvas.h" | 9 #include "app/gfx/canvas.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "chrome/browser/find_bar_controller.h" | 13 #include "chrome/browser/find_bar_controller.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/views/find_bar_win.h" | 15 #include "chrome/browser/views/find_bar_win.h" |
| 16 #include "chrome/browser/view_ids.h" | 16 #include "chrome/browser/view_ids.h" |
| 17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 19 #include "third_party/skia/include/effects/SkGradientShader.h" | 19 #include "third_party/skia/include/effects/SkGradientShader.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 find_text_->SelectAll(); | 230 find_text_->SelectAll(); |
| 231 | 231 |
| 232 find_previous_button_->SetEnabled(true); | 232 find_previous_button_->SetEnabled(true); |
| 233 find_next_button_->SetEnabled(true); | 233 find_next_button_->SetEnabled(true); |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 /////////////////////////////////////////////////////////////////////////////// | 237 /////////////////////////////////////////////////////////////////////////////// |
| 238 // FindBarView, views::View overrides: | 238 // FindBarView, views::View overrides: |
| 239 | 239 |
| 240 void FindBarView::Paint(ChromeCanvas* canvas) { | 240 void FindBarView::Paint(gfx::Canvas* canvas) { |
| 241 SkPaint paint; | 241 SkPaint paint; |
| 242 | 242 |
| 243 // Get the local bounds so that we now how much to stretch the background. | 243 // Get the local bounds so that we now how much to stretch the background. |
| 244 gfx::Rect lb = GetLocalBounds(true); | 244 gfx::Rect lb = GetLocalBounds(true); |
| 245 | 245 |
| 246 // First, we draw the background image for the whole dialog (3 images: left, | 246 // First, we draw the background image for the whole dialog (3 images: left, |
| 247 // middle and right). Note, that the window region has been set by the | 247 // middle and right). Note, that the window region has been set by the |
| 248 // controller, so the whitespace in the left and right background images is | 248 // controller, so the whitespace in the left and right background images is |
| 249 // actually outside the window region and is therefore not drawn. See | 249 // actually outside the window region and is therefore not drawn. See |
| 250 // FindInPageWidgetWin::CreateRoundedWindowEdges() for details. | 250 // FindInPageWidgetWin::CreateRoundedWindowEdges() for details. |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 } | 492 } |
| 493 | 493 |
| 494 bool FindBarView::FocusForwarderView::OnMousePressed( | 494 bool FindBarView::FocusForwarderView::OnMousePressed( |
| 495 const views::MouseEvent& event) { | 495 const views::MouseEvent& event) { |
| 496 if (view_to_focus_on_mousedown_) { | 496 if (view_to_focus_on_mousedown_) { |
| 497 view_to_focus_on_mousedown_->ClearSelection(); | 497 view_to_focus_on_mousedown_->ClearSelection(); |
| 498 view_to_focus_on_mousedown_->RequestFocus(); | 498 view_to_focus_on_mousedown_->RequestFocus(); |
| 499 } | 499 } |
| 500 return true; | 500 return true; |
| 501 } | 501 } |
| OLD | NEW |