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/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // FindBarView, public: | 71 // FindBarView, public: |
72 | 72 |
73 FindBarView::FindBarView(FindBarHost* host) | 73 FindBarView::FindBarView(FindBarHost* host) |
74 : DropdownBarView(host), | 74 : DropdownBarView(host), |
75 find_text_(NULL), | 75 find_text_(NULL), |
76 match_count_text_(NULL), | 76 match_count_text_(NULL), |
77 focus_forwarder_view_(NULL), | 77 focus_forwarder_view_(NULL), |
78 find_previous_button_(NULL), | 78 find_previous_button_(NULL), |
79 find_next_button_(NULL), | 79 find_next_button_(NULL), |
80 close_button_(NULL) { | 80 close_button_(NULL) { |
81 set_id(VIEW_ID_FIND_IN_PAGE); | |
82 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 81 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
83 | 82 |
84 find_text_ = new views::Textfield; | 83 find_text_ = new views::Textfield; |
85 find_text_->set_id(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); | 84 find_text_->set_id(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); |
86 find_text_->set_default_width_in_chars(kDefaultCharWidth); | 85 find_text_->set_default_width_in_chars(kDefaultCharWidth); |
87 find_text_->set_controller(this); | 86 find_text_->set_controller(this); |
88 find_text_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND)); | 87 find_text_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND)); |
89 // The find bar textfield has a background image instead of a border. | 88 // The find bar textfield has a background image instead of a border. |
90 find_text_->SetBorder(views::Border::NullBorder()); | 89 find_text_->SetBorder(views::Border::NullBorder()); |
91 AddChildView(find_text_); | 90 AddChildView(find_text_); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 489 |
491 void FindBarView::OnThemeChanged() { | 490 void FindBarView::OnThemeChanged() { |
492 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 491 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
493 if (GetThemeProvider()) { | 492 if (GetThemeProvider()) { |
494 close_button_->SetBackground( | 493 close_button_->SetBackground( |
495 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), | 494 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), |
496 rb.GetImageSkiaNamed(IDR_CLOSE_1), | 495 rb.GetImageSkiaNamed(IDR_CLOSE_1), |
497 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); | 496 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); |
498 } | 497 } |
499 } | 498 } |
OLD | NEW |