Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 2143703002: Enable find in page buttons based on search text rather than match (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // sent for a lot more things than just the user nulling out the search 587 // sent for a lot more things than just the user nulling out the search
588 // terms. See http://crbug.com/45372. 588 // terms. See http://crbug.com/45372.
589 Profile* profile = 589 Profile* profile =
590 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 590 Profile::FromBrowserContext(web_contents->GetBrowserContext());
591 FindBarState* find_bar_state = FindBarStateFactory::GetForProfile(profile); 591 FindBarState* find_bar_state = FindBarStateFactory::GetForProfile(profile);
592 find_bar_state->set_last_prepopulate_text(base::string16()); 592 find_bar_state->set_last_prepopulate_text(base::string16());
593 } 593 }
594 } 594 }
595 595
596 void FindBarView::UpdateMatchCountAppearance(bool no_match) { 596 void FindBarView::UpdateMatchCountAppearance(bool no_match) {
597 bool enable_buttons = !match_count_text_->text().empty() && !no_match; 597 bool enable_buttons = !find_text_->text().empty() && !no_match;
598 find_previous_button_->SetEnabled(enable_buttons); 598 find_previous_button_->SetEnabled(enable_buttons);
599 find_next_button_->SetEnabled(enable_buttons); 599 find_next_button_->SetEnabled(enable_buttons);
600 600
601 if (ui::MaterialDesignController::IsModeMaterial()) 601 if (ui::MaterialDesignController::IsModeMaterial())
602 return; 602 return;
603 603
604 if (no_match) { 604 if (no_match) {
605 match_count_text_->SetBackgroundColor(kBackgroundColorNoMatch); 605 match_count_text_->SetBackgroundColor(kBackgroundColorNoMatch);
606 match_count_text_->SetEnabledColor(kTextColorNoMatch); 606 match_count_text_->SetEnabledColor(kTextColorNoMatch);
607 } else { 607 } else {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 SkColor text_color = 650 SkColor text_color =
651 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); 651 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor);
652 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); 652 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69));
653 separator_->SetColor(SkColorSetA(text_color, 0x26)); 653 separator_->SetColor(SkColorSetA(text_color, 0x26));
654 } 654 }
655 655
656 SkColor FindBarView::GetTextColorForIcon() { 656 SkColor FindBarView::GetTextColorForIcon() {
657 return GetNativeTheme()->GetSystemColor( 657 return GetNativeTheme()->GetSystemColor(
658 ui::NativeTheme::kColorId_TextfieldDefaultColor); 658 ui::NativeTheme::kColorId_TextfieldDefaultColor);
659 } 659 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698