| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 case VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON: | 419 case VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON: |
| 420 case VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON: | 420 case VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON: |
| 421 if (!find_text_->text().empty()) { | 421 if (!find_text_->text().empty()) { |
| 422 FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents( | 422 FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents( |
| 423 find_bar_host()->GetFindBarController()->web_contents()); | 423 find_bar_host()->GetFindBarController()->web_contents()); |
| 424 find_tab_helper->StartFinding( | 424 find_tab_helper->StartFinding( |
| 425 find_text_->text(), | 425 find_text_->text(), |
| 426 sender->id() == VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON, | 426 sender->id() == VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON, |
| 427 false); // Not case sensitive. | 427 false); // Not case sensitive. |
| 428 } | 428 } |
| 429 | |
| 430 if (event.IsMouseEvent()) { | |
| 431 // Move focus to the find textfield. | |
| 432 find_text_->RequestFocus(); | |
| 433 } | |
| 434 break; | 429 break; |
| 435 case VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON: | 430 case VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON: |
| 436 find_bar_host()->GetFindBarController()->EndFindSession( | 431 find_bar_host()->GetFindBarController()->EndFindSession( |
| 437 FindBarController::kKeepSelectionOnPage, | 432 FindBarController::kKeepSelectionOnPage, |
| 438 FindBarController::kKeepResultsInFindBox); | 433 FindBarController::kKeepResultsInFindBox); |
| 439 break; | 434 break; |
| 440 default: | 435 default: |
| 441 NOTREACHED() << "Unknown button"; | 436 NOTREACHED() << "Unknown button"; |
| 442 break; | 437 break; |
| 443 } | 438 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 SkColor text_color = | 650 SkColor text_color = |
| 656 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 651 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 657 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 652 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
| 658 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 653 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
| 659 } | 654 } |
| 660 | 655 |
| 661 SkColor FindBarView::GetTextColorForIcon() { | 656 SkColor FindBarView::GetTextColorForIcon() { |
| 662 return GetNativeTheme()->GetSystemColor( | 657 return GetNativeTheme()->GetSystemColor( |
| 663 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 658 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 664 } | 659 } |
| OLD | NEW |