| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 507 |
| 508 bool FindBarView::HandleKeyEvent(views::Textfield* sender, | 508 bool FindBarView::HandleKeyEvent(views::Textfield* sender, |
| 509 const views::KeyEvent& key_event) { | 509 const views::KeyEvent& key_event) { |
| 510 // If the dialog is not visible, there is no reason to process keyboard input. | 510 // If the dialog is not visible, there is no reason to process keyboard input. |
| 511 if (!host()->IsVisible()) | 511 if (!host()->IsVisible()) |
| 512 return false; | 512 return false; |
| 513 | 513 |
| 514 if (find_bar_host()->MaybeForwardKeyEventToWebpage(key_event)) | 514 if (find_bar_host()->MaybeForwardKeyEventToWebpage(key_event)) |
| 515 return true; // Handled, we are done! | 515 return true; // Handled, we are done! |
| 516 | 516 |
| 517 if (key_event.GetKeyCode() == ui::VKEY_RETURN) { | 517 if (key_event.key_code() == ui::VKEY_RETURN) { |
| 518 // Pressing Return/Enter starts the search (unless text box is empty). | 518 // Pressing Return/Enter starts the search (unless text box is empty). |
| 519 string16 find_string = find_text_->text(); | 519 string16 find_string = find_text_->text(); |
| 520 if (!find_string.empty()) { | 520 if (!find_string.empty()) { |
| 521 FindBarController* controller = find_bar_host()->GetFindBarController(); | 521 FindBarController* controller = find_bar_host()->GetFindBarController(); |
| 522 FindManager* find_manager = controller->tab_contents()->GetFindManager(); | 522 FindManager* find_manager = controller->tab_contents()->GetFindManager(); |
| 523 // Search forwards for enter, backwards for shift-enter. | 523 // Search forwards for enter, backwards for shift-enter. |
| 524 find_manager->StartFinding(find_string, | 524 find_manager->StartFinding(find_string, |
| 525 !key_event.IsShiftDown(), | 525 !key_event.IsShiftDown(), |
| 526 false); // Not case sensitive. | 526 false); // Not case sensitive. |
| 527 } | 527 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 void FindBarView::OnThemeChanged() { | 569 void FindBarView::OnThemeChanged() { |
| 570 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 570 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 571 if (GetThemeProvider()) { | 571 if (GetThemeProvider()) { |
| 572 close_button_->SetBackground( | 572 close_button_->SetBackground( |
| 573 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), | 573 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), |
| 574 rb.GetBitmapNamed(IDR_CLOSE_BAR), | 574 rb.GetBitmapNamed(IDR_CLOSE_BAR), |
| 575 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); | 575 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); |
| 576 } | 576 } |
| 577 } | 577 } |
| OLD | NEW |