| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 468 |
| 469 bool FindBarView::HandleKeystroke(views::Textfield* sender, | 469 bool FindBarView::HandleKeystroke(views::Textfield* sender, |
| 470 const views::Textfield::Keystroke& key) { | 470 const views::Textfield::Keystroke& key) { |
| 471 // If the dialog is not visible, there is no reason to process keyboard input. | 471 // If the dialog is not visible, there is no reason to process keyboard input. |
| 472 if (!host()->IsVisible()) | 472 if (!host()->IsVisible()) |
| 473 return false; | 473 return false; |
| 474 | 474 |
| 475 if (find_bar_host()->MaybeForwardKeystrokeToWebpage(key)) | 475 if (find_bar_host()->MaybeForwardKeystrokeToWebpage(key)) |
| 476 return true; // Handled, we are done! | 476 return true; // Handled, we are done! |
| 477 | 477 |
| 478 if (key.GetKeyboardCode() == app::VKEY_RETURN) { | 478 if (key.GetKeyboardCode() == base::VKEY_RETURN) { |
| 479 // Pressing Return/Enter starts the search (unless text box is empty). | 479 // Pressing Return/Enter starts the search (unless text box is empty). |
| 480 string16 find_string = find_text_->text(); | 480 string16 find_string = find_text_->text(); |
| 481 if (!find_string.empty()) { | 481 if (!find_string.empty()) { |
| 482 // Search forwards for enter, backwards for shift-enter. | 482 // Search forwards for enter, backwards for shift-enter. |
| 483 find_bar_host()->GetFindBarController()->tab_contents()->StartFinding( | 483 find_bar_host()->GetFindBarController()->tab_contents()->StartFinding( |
| 484 find_string, | 484 find_string, |
| 485 !key.IsShiftHeld(), | 485 !key.IsShiftHeld(), |
| 486 false); // Not case sensitive. | 486 false); // Not case sensitive. |
| 487 } | 487 } |
| 488 } | 488 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 517 | 517 |
| 518 void FindBarView::OnThemeChanged() { | 518 void FindBarView::OnThemeChanged() { |
| 519 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 519 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 520 if (GetThemeProvider()) { | 520 if (GetThemeProvider()) { |
| 521 close_button_->SetBackground( | 521 close_button_->SetBackground( |
| 522 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), | 522 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), |
| 523 rb.GetBitmapNamed(IDR_CLOSE_BAR), | 523 rb.GetBitmapNamed(IDR_CLOSE_BAR), |
| 524 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); | 524 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); |
| 525 } | 525 } |
| 526 } | 526 } |
| OLD | NEW |