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/location_bar/keyword_hint_view.h" | 5 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 leading_label_->SetBounds(0, 0, show_labels ? leading_size.width() : 0, | 85 leading_label_->SetBounds(0, 0, show_labels ? leading_size.width() : 0, |
86 height()); | 86 height()); |
87 tab_image_->SetBounds(leading_label_->bounds().right(), 0, tab_width, | 87 tab_image_->SetBounds(leading_label_->bounds().right(), 0, tab_width, |
88 height()); | 88 height()); |
89 gfx::Size trailing_size(trailing_label_->GetPreferredSize()); | 89 gfx::Size trailing_size(trailing_label_->GetPreferredSize()); |
90 trailing_label_->SetBounds(tab_image_->bounds().right(), 0, | 90 trailing_label_->SetBounds(tab_image_->bounds().right(), 0, |
91 show_labels ? trailing_size.width() : 0, | 91 show_labels ? trailing_size.width() : 0, |
92 height()); | 92 height()); |
93 } | 93 } |
94 | 94 |
| 95 const char* KeywordHintView::GetClassName() const { |
| 96 return "KeywordHintView"; |
| 97 } |
| 98 |
95 views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list, | 99 views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list, |
96 SkColor text_color, | 100 SkColor text_color, |
97 SkColor background_color) { | 101 SkColor background_color) { |
98 views::Label* label = new views::Label(base::string16(), font_list); | 102 views::Label* label = new views::Label(base::string16(), font_list); |
99 label->SetEnabledColor(text_color); | 103 label->SetEnabledColor(text_color); |
100 label->SetBackgroundColor(background_color); | 104 label->SetBackgroundColor(background_color); |
101 AddChildView(label); | 105 AddChildView(label); |
102 return label; | 106 return label; |
103 } | 107 } |
OLD | NEW |