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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 find_next_button_(NULL), | 77 find_next_button_(NULL), |
78 close_button_(NULL), | 78 close_button_(NULL), |
79 text_box_background_(NULL), | 79 text_box_background_(NULL), |
80 text_box_background_left_(NULL) { | 80 text_box_background_left_(NULL) { |
81 set_id(VIEW_ID_FIND_IN_PAGE); | 81 set_id(VIEW_ID_FIND_IN_PAGE); |
82 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 82 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
83 | 83 |
84 find_text_ = new views::Textfield; | 84 find_text_ = new views::Textfield; |
85 find_text_->set_id(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); | 85 find_text_->set_id(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); |
86 find_text_->set_default_width_in_chars(kDefaultCharWidth); | 86 find_text_->set_default_width_in_chars(kDefaultCharWidth); |
87 find_text_->SetController(this); | 87 find_text_->set_controller(this); |
88 find_text_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND)); | 88 find_text_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND)); |
89 // The find bar textfield has a background image instead of a border. | 89 // The find bar textfield has a background image instead of a border. |
90 const gfx::Insets insets = find_text_->GetInsets(); | 90 const gfx::Insets insets = find_text_->GetInsets(); |
91 find_text_->set_border( | 91 find_text_->set_border( |
92 views::Border::CreateEmptyBorder(insets.top(), 0, insets.bottom(), 2)); | 92 views::Border::CreateEmptyBorder(insets.top(), 0, insets.bottom(), 2)); |
93 | 93 |
94 AddChildView(find_text_); | 94 AddChildView(find_text_); |
95 | 95 |
96 match_count_text_ = new views::Label(); | 96 match_count_text_ = new views::Label(); |
97 AddChildView(match_count_text_); | 97 AddChildView(match_count_text_); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 void FindBarView::OnThemeChanged() { | 497 void FindBarView::OnThemeChanged() { |
498 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 498 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
499 if (GetThemeProvider()) { | 499 if (GetThemeProvider()) { |
500 close_button_->SetBackground( | 500 close_button_->SetBackground( |
501 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), | 501 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), |
502 rb.GetImageSkiaNamed(IDR_CLOSE_1), | 502 rb.GetImageSkiaNamed(IDR_CLOSE_1), |
503 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); | 503 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); |
504 } | 504 } |
505 } | 505 } |
OLD | NEW |