Chromium Code Reviews| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 | 429 |
| 430 if (event.IsMouseEvent()) { | 430 // Focus the textfield, unless the button was invoked with a key press. |
| 431 // Move focus to the find textfield. | 431 // That lets the user continuously press SPACE/ENTER on next/previous. |
|
Peter Kasting
2016/06/17 20:55:47
Nit: We might want to note why we'd want to move f
msw
2016/06/18 00:25:18
As discussed, I'm removing this workaround added f
| |
| 432 if (!event.IsKeyEvent()) | |
| 432 find_text_->RequestFocus(); | 433 find_text_->RequestFocus(); |
| 433 } | |
| 434 break; | 434 break; |
| 435 case VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON: | 435 case VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON: |
| 436 find_bar_host()->GetFindBarController()->EndFindSession( | 436 find_bar_host()->GetFindBarController()->EndFindSession( |
| 437 FindBarController::kKeepSelectionOnPage, | 437 FindBarController::kKeepSelectionOnPage, |
| 438 FindBarController::kKeepResultsInFindBox); | 438 FindBarController::kKeepResultsInFindBox); |
| 439 break; | 439 break; |
| 440 default: | 440 default: |
| 441 NOTREACHED() << "Unknown button"; | 441 NOTREACHED() << "Unknown button"; |
| 442 break; | 442 break; |
| 443 } | 443 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 655 SkColor text_color = | 655 SkColor text_color = |
| 656 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 656 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 657 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 657 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
| 658 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 658 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
| 659 } | 659 } |
| 660 | 660 |
| 661 SkColor FindBarView::GetTextColorForIcon() { | 661 SkColor FindBarView::GetTextColorForIcon() { |
| 662 return GetNativeTheme()->GetSystemColor( | 662 return GetNativeTheme()->GetSystemColor( |
| 663 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 663 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 664 } | 664 } |
| OLD | NEW |