| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 views::Button::ConfigureDefaultFocus(find_previous_button_); | 157 views::Button::ConfigureDefaultFocus(find_previous_button_); |
| 158 find_previous_button_->set_request_focus_on_press(false); | |
| 159 find_previous_button_->SetTooltipText( | 158 find_previous_button_->SetTooltipText( |
| 160 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)); | 159 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)); |
| 161 find_previous_button_->SetAccessibleName( | 160 find_previous_button_->SetAccessibleName( |
| 162 l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS)); | 161 l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS)); |
| 163 AddChildView(find_previous_button_); | 162 AddChildView(find_previous_button_); |
| 164 | 163 |
| 165 find_next_button_->set_id(VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON); | 164 find_next_button_->set_id(VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON); |
| 166 views::Button::ConfigureDefaultFocus(find_next_button_); | 165 views::Button::ConfigureDefaultFocus(find_next_button_); |
| 167 find_next_button_->set_request_focus_on_press(false); | |
| 168 find_next_button_->SetTooltipText( | 166 find_next_button_->SetTooltipText( |
| 169 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)); | 167 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)); |
| 170 find_next_button_->SetAccessibleName( | 168 find_next_button_->SetAccessibleName( |
| 171 l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT)); | 169 l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT)); |
| 172 AddChildView(find_next_button_); | 170 AddChildView(find_next_button_); |
| 173 | 171 |
| 174 close_button_->set_id(VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON); | 172 close_button_->set_id(VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON); |
| 175 views::Button::ConfigureDefaultFocus(close_button_); | 173 views::Button::ConfigureDefaultFocus(close_button_); |
| 176 close_button_->set_request_focus_on_press(false); | |
| 177 close_button_->SetTooltipText( | 174 close_button_->SetTooltipText( |
| 178 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)); | 175 l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)); |
| 179 close_button_->SetAccessibleName( | 176 close_button_->SetAccessibleName( |
| 180 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 177 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
| 181 close_button_->SetAnimationDuration(0); | 178 close_button_->SetAnimationDuration(0); |
| 182 AddChildView(close_button_); | 179 AddChildView(close_button_); |
| 183 | 180 |
| 184 // Create a focus forwarder view which sends focus to find_text_. | 181 // Create a focus forwarder view which sends focus to find_text_. |
| 185 focus_forwarder_view_ = new FocusForwarderView(find_text_); | 182 focus_forwarder_view_ = new FocusForwarderView(find_text_); |
| 186 AddChildView(focus_forwarder_view_); | 183 AddChildView(focus_forwarder_view_); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 SkColor text_color = | 654 SkColor text_color = |
| 658 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 655 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 659 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 656 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
| 660 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 657 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
| 661 } | 658 } |
| 662 | 659 |
| 663 SkColor FindBarView::GetTextColorForIcon() { | 660 SkColor FindBarView::GetTextColorForIcon() { |
| 664 return GetNativeTheme()->GetSystemColor( | 661 return GetNativeTheme()->GetSystemColor( |
| 665 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 662 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 666 } | 663 } |
| OLD | NEW |