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 "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/find_bar_controller.h" | 10 #include "chrome/browser/find_bar_controller.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 | 426 |
427 void FindBarView::ButtonPressed(views::Button* sender) { | 427 void FindBarView::ButtonPressed(views::Button* sender) { |
428 switch (sender->tag()) { | 428 switch (sender->tag()) { |
429 case FIND_PREVIOUS_TAG: | 429 case FIND_PREVIOUS_TAG: |
430 case FIND_NEXT_TAG: | 430 case FIND_NEXT_TAG: |
431 if (find_text_->GetText().length() > 0) { | 431 if (find_text_->GetText().length() > 0) { |
432 container_->GetFindBarController()->web_contents()->StartFinding( | 432 container_->GetFindBarController()->web_contents()->StartFinding( |
433 find_text_->GetText(), | 433 find_text_->GetText(), |
434 sender->tag() == FIND_NEXT_TAG); | 434 sender->tag() == FIND_NEXT_TAG); |
435 } | 435 } |
436 // Move the focus back to the text-field, we don't want the button | |
437 // focused. | |
438 find_text_->RequestFocus(); | |
Finnur
2009/04/08 15:22:36
Wait... what happens if I press Tab twice (startin
| |
436 break; | 439 break; |
437 case CLOSE_TAG: | 440 case CLOSE_TAG: |
438 container_->GetFindBarController()->EndFindSession(); | 441 container_->GetFindBarController()->EndFindSession(); |
439 break; | 442 break; |
440 default: | 443 default: |
441 NOTREACHED() << L"Unknown button"; | 444 NOTREACHED() << L"Unknown button"; |
442 break; | 445 break; |
443 } | 446 } |
444 } | 447 } |
445 | 448 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 } | 499 } |
497 | 500 |
498 bool FindBarView::FocusForwarderView::OnMousePressed( | 501 bool FindBarView::FocusForwarderView::OnMousePressed( |
499 const views::MouseEvent& event) { | 502 const views::MouseEvent& event) { |
500 if (view_to_focus_on_mousedown_) { | 503 if (view_to_focus_on_mousedown_) { |
501 view_to_focus_on_mousedown_->ClearSelection(); | 504 view_to_focus_on_mousedown_->ClearSelection(); |
502 view_to_focus_on_mousedown_->RequestFocus(); | 505 view_to_focus_on_mousedown_->RequestFocus(); |
503 } | 506 } |
504 return true; | 507 return true; |
505 } | 508 } |
OLD | NEW |