| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 find_previous_button_ = find_previous; | 147 find_previous_button_ = find_previous; |
| 148 find_next_button_ = find_next; | 148 find_next_button_ = find_next; |
| 149 close_button_ = close; | 149 close_button_ = close; |
| 150 } else { | 150 } else { |
| 151 find_previous_button_ = new views::ImageButton(this); | 151 find_previous_button_ = new views::ImageButton(this); |
| 152 find_next_button_ = new views::ImageButton(this); | 152 find_next_button_ = new views::ImageButton(this); |
| 153 close_button_ = new views::ImageButton(this); | 153 close_button_ = new views::ImageButton(this); |
| 154 } | 154 } |
| 155 | 155 |
| 156 find_previous_button_->set_id(VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON); | 156 find_previous_button_->set_id(VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON); |
| 157 find_previous_button_->SetFocusBehavior(FocusBehavior::ALWAYS); | 157 views::Button::ConfigureDefaultFocus(find_previous_button_); |
| 158 find_previous_button_->set_request_focus_on_press(false); | 158 find_previous_button_->set_request_focus_on_press(false); |
| 159 find_previous_button_->SetTooltipText( | 159 find_previous_button_->SetTooltipText( |
| 160 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)); | 160 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)); |
| 161 find_previous_button_->SetAccessibleName( | 161 find_previous_button_->SetAccessibleName( |
| 162 l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS)); | 162 l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS)); |
| 163 AddChildView(find_previous_button_); | 163 AddChildView(find_previous_button_); |
| 164 | 164 |
| 165 find_next_button_->set_id(VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON); | 165 find_next_button_->set_id(VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON); |
| 166 find_next_button_->SetFocusBehavior(FocusBehavior::ALWAYS); | 166 views::Button::ConfigureDefaultFocus(find_next_button_); |
| 167 find_next_button_->set_request_focus_on_press(false); | 167 find_next_button_->set_request_focus_on_press(false); |
| 168 find_next_button_->SetTooltipText( | 168 find_next_button_->SetTooltipText( |
| 169 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)); | 169 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)); |
| 170 find_next_button_->SetAccessibleName( | 170 find_next_button_->SetAccessibleName( |
| 171 l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT)); | 171 l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT)); |
| 172 AddChildView(find_next_button_); | 172 AddChildView(find_next_button_); |
| 173 | 173 |
| 174 close_button_->set_id(VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON); | 174 close_button_->set_id(VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON); |
| 175 close_button_->SetFocusBehavior(FocusBehavior::ALWAYS); | 175 views::Button::ConfigureDefaultFocus(close_button_); |
| 176 close_button_->set_request_focus_on_press(false); | 176 close_button_->set_request_focus_on_press(false); |
| 177 close_button_->SetTooltipText( | 177 close_button_->SetTooltipText( |
| 178 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)); | 178 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)); |
| 179 close_button_->SetAccessibleName( | 179 close_button_->SetAccessibleName( |
| 180 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 180 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
| 181 close_button_->SetAnimationDuration(0); | 181 close_button_->SetAnimationDuration(0); |
| 182 AddChildView(close_button_); | 182 AddChildView(close_button_); |
| 183 | 183 |
| 184 // Create a focus forwarder view which sends focus to find_text_. | 184 // Create a focus forwarder view which sends focus to find_text_. |
| 185 focus_forwarder_view_ = new FocusForwarderView(find_text_); | 185 focus_forwarder_view_ = new FocusForwarderView(find_text_); |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 SkColor text_color = | 657 SkColor text_color = |
| 658 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 658 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 659 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 659 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
| 660 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 660 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
| 661 } | 661 } |
| 662 | 662 |
| 663 SkColor FindBarView::GetTextColorForIcon() { | 663 SkColor FindBarView::GetTextColorForIcon() { |
| 664 return GetNativeTheme()->GetSystemColor( | 664 return GetNativeTheme()->GetSystemColor( |
| 665 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 665 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 666 } | 666 } |
| OLD | NEW |