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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const SkColor kTextColorNoMatch = SK_ColorBLACK; | 84 const SkColor kTextColorNoMatch = SK_ColorBLACK; |
85 | 85 |
86 // The background color of the match count label when results are found. | 86 // The background color of the match count label when results are found. |
87 const SkColor kBackgroundColorMatch = SkColorSetARGB(0, 255, 255, 255); | 87 const SkColor kBackgroundColorMatch = SkColorSetARGB(0, 255, 255, 255); |
88 | 88 |
89 // The background color of the match count label when no results are found. | 89 // The background color of the match count label when no results are found. |
90 const SkColor kBackgroundColorNoMatch = SkColorSetRGB(255, 102, 102); | 90 const SkColor kBackgroundColorNoMatch = SkColorSetRGB(255, 102, 102); |
91 | 91 |
92 // The default number of average characters that the text box will be. | 92 // The default number of average characters that the text box will be. |
93 const int kDefaultCharWidth = 43; | 93 const int kDefaultCharWidth = 43; |
94 const int kDefaultCharWidthMd = 26; | 94 const int kDefaultCharWidthMd = 30; |
95 | 95 |
96 // The match count label is like a normal label, but can process events (which | 96 // The match count label is like a normal label, but can process events (which |
97 // makes it easier to forward events to the text input --- see | 97 // makes it easier to forward events to the text input --- see |
98 // FindBarView::TargetForRect). | 98 // FindBarView::TargetForRect). |
99 class MatchCountLabel : public views::Label { | 99 class MatchCountLabel : public views::Label { |
100 public: | 100 public: |
101 MatchCountLabel() {} | 101 MatchCountLabel() {} |
102 ~MatchCountLabel() override {} | 102 ~MatchCountLabel() override {} |
103 | 103 |
104 // views::Label overrides: | 104 // views::Label overrides: |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 SkColor text_color = | 663 SkColor text_color = |
664 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 664 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
665 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 665 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
666 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 666 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
667 } | 667 } |
668 | 668 |
669 SkColor FindBarView::GetTextColorForIcon() { | 669 SkColor FindBarView::GetTextColorForIcon() { |
670 return GetNativeTheme()->GetSystemColor( | 670 return GetNativeTheme()->GetSystemColor( |
671 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 671 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
672 } | 672 } |
OLD | NEW |