| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 // sent for a lot more things than just the user nulling out the search | 598 // sent for a lot more things than just the user nulling out the search |
| 599 // terms. See http://crbug.com/45372. | 599 // terms. See http://crbug.com/45372. |
| 600 Profile* profile = | 600 Profile* profile = |
| 601 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 601 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 602 FindBarState* find_bar_state = FindBarStateFactory::GetForProfile(profile); | 602 FindBarState* find_bar_state = FindBarStateFactory::GetForProfile(profile); |
| 603 find_bar_state->set_last_prepopulate_text(base::string16()); | 603 find_bar_state->set_last_prepopulate_text(base::string16()); |
| 604 } | 604 } |
| 605 } | 605 } |
| 606 | 606 |
| 607 void FindBarView::UpdateMatchCountAppearance(bool no_match) { | 607 void FindBarView::UpdateMatchCountAppearance(bool no_match) { |
| 608 // Enable the buttons if there is a match or if there is a match count text | 608 bool enable_buttons = !match_count_text_->text().empty() && !no_match; |
| 609 // set (from a prepopulated view). | |
| 610 bool enable_buttons = !match_count_text_->text().empty() || !no_match; | |
| 611 find_previous_button_->SetEnabled(enable_buttons); | 609 find_previous_button_->SetEnabled(enable_buttons); |
| 612 find_next_button_->SetEnabled(enable_buttons); | 610 find_next_button_->SetEnabled(enable_buttons); |
| 613 | 611 |
| 614 if (ui::MaterialDesignController::IsModeMaterial()) | 612 if (ui::MaterialDesignController::IsModeMaterial()) |
| 615 return; | 613 return; |
| 616 | 614 |
| 617 if (no_match) { | 615 if (no_match) { |
| 618 match_count_text_->SetBackgroundColor(kBackgroundColorNoMatch); | 616 match_count_text_->SetBackgroundColor(kBackgroundColorNoMatch); |
| 619 match_count_text_->SetEnabledColor(kTextColorNoMatch); | 617 match_count_text_->SetEnabledColor(kTextColorNoMatch); |
| 620 } else { | 618 } else { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 SkColor text_color = | 661 SkColor text_color = |
| 664 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 662 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 665 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 663 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
| 666 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 664 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
| 667 } | 665 } |
| 668 | 666 |
| 669 SkColor FindBarView::GetTextColorForIcon() { | 667 SkColor FindBarView::GetTextColorForIcon() { |
| 670 return GetNativeTheme()->GetSystemColor( | 668 return GetNativeTheme()->GetSystemColor( |
| 671 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 669 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 672 } | 670 } |
| OLD | NEW |