| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |