OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 gfx::Size panel_size = GetPreferredSize(); | 316 gfx::Size panel_size = GetPreferredSize(); |
317 | 317 |
318 // First we draw the close button on the far right. | 318 // First we draw the close button on the far right. |
319 gfx::Size sz = close_button_->GetPreferredSize(); | 319 gfx::Size sz = close_button_->GetPreferredSize(); |
320 close_button_->SetBounds(panel_size.width() - sz.width() - | 320 close_button_->SetBounds(panel_size.width() - sz.width() - |
321 kMarginRightOfCloseButton, | 321 kMarginRightOfCloseButton, |
322 (height() - sz.height()) / 2, | 322 (height() - sz.height()) / 2, |
323 sz.width(), | 323 sz.width(), |
324 sz.height()); | 324 sz.height()); |
325 // Set the color. | 325 // Set the color. |
326 ThemeChanged(); | 326 OnThemeChanged(); |
327 | 327 |
328 // Next, the FindNext button to the left the close button. | 328 // Next, the FindNext button to the left the close button. |
329 sz = find_next_button_->GetPreferredSize(); | 329 sz = find_next_button_->GetPreferredSize(); |
330 find_next_button_->SetBounds(close_button_->x() - | 330 find_next_button_->SetBounds(close_button_->x() - |
331 find_next_button_->width() - | 331 find_next_button_->width() - |
332 kMarginLeftOfCloseButton, | 332 kMarginLeftOfCloseButton, |
333 (height() - sz.height()) / 2, | 333 (height() - sz.height()) / 2, |
334 sz.width(), | 334 sz.width(), |
335 sz.height()); | 335 sz.height()); |
336 | 336 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 view_to_focus_on_mousedown_->ClearSelection(); | 518 view_to_focus_on_mousedown_->ClearSelection(); |
519 view_to_focus_on_mousedown_->RequestFocus(); | 519 view_to_focus_on_mousedown_->RequestFocus(); |
520 } | 520 } |
521 return true; | 521 return true; |
522 } | 522 } |
523 | 523 |
524 FindBarHost* FindBarView::find_bar_host() const { | 524 FindBarHost* FindBarView::find_bar_host() const { |
525 return static_cast<FindBarHost*>(host()); | 525 return static_cast<FindBarHost*>(host()); |
526 } | 526 } |
527 | 527 |
528 void FindBarView::ThemeChanged() { | 528 void FindBarView::OnThemeChanged() { |
529 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 529 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
530 if (GetThemeProvider()) { | 530 if (GetThemeProvider()) { |
531 close_button_->SetBackground( | 531 close_button_->SetBackground( |
532 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), | 532 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), |
533 rb.GetBitmapNamed(IDR_CLOSE_BAR), | 533 rb.GetBitmapNamed(IDR_CLOSE_BAR), |
534 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); | 534 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); |
535 } | 535 } |
536 } | 536 } |
OLD | NEW |