OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/app_list/views/folder_header_view.h" | 5 #include "ui/app_list/views/folder_header_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 folder_name_view_->SetVisible(folder_name_visible_); | 120 folder_name_view_->SetVisible(folder_name_visible_); |
121 if (folder_name_visible_) { | 121 if (folder_name_visible_) { |
122 folder_name_view_->SetText(base::UTF8ToUTF16(folder_item_->name())); | 122 folder_name_view_->SetText(base::UTF8ToUTF16(folder_item_->name())); |
123 folder_name_view_->Update(); | 123 folder_name_view_->Update(); |
124 } | 124 } |
125 | 125 |
126 Layout(); | 126 Layout(); |
127 } | 127 } |
128 | 128 |
| 129 const base::string16& FolderHeaderView::GetFolderNameForTest() { |
| 130 return folder_name_view_->text(); |
| 131 } |
| 132 |
| 133 void FolderHeaderView::SetFolderNameForTest(const base::string16& name) { |
| 134 folder_name_view_->SetText(name); |
| 135 } |
| 136 |
| 137 bool FolderHeaderView::IsFolderNameEnabledForTest() const { |
| 138 return folder_name_view_->enabled(); |
| 139 } |
| 140 |
129 gfx::Size FolderHeaderView::GetPreferredSize() { | 141 gfx::Size FolderHeaderView::GetPreferredSize() { |
130 return gfx::Size(kPreferredWidth, kPreferredHeight); | 142 return gfx::Size(kPreferredWidth, kPreferredHeight); |
131 } | 143 } |
132 | 144 |
133 void FolderHeaderView::Layout() { | 145 void FolderHeaderView::Layout() { |
134 gfx::Rect rect(GetContentsBounds()); | 146 gfx::Rect rect(GetContentsBounds()); |
135 if (rect.IsEmpty()) | 147 if (rect.IsEmpty()) |
136 return; | 148 return; |
137 | 149 |
138 gfx::Rect back_bounds(rect); | 150 gfx::Rect back_bounds(rect); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 void FolderHeaderView::ItemHighlightedChanged() { | 221 void FolderHeaderView::ItemHighlightedChanged() { |
210 } | 222 } |
211 | 223 |
212 void FolderHeaderView::ItemIsInstallingChanged() { | 224 void FolderHeaderView::ItemIsInstallingChanged() { |
213 } | 225 } |
214 | 226 |
215 void FolderHeaderView::ItemPercentDownloadedChanged() { | 227 void FolderHeaderView::ItemPercentDownloadedChanged() { |
216 } | 228 } |
217 | 229 |
218 } // namespace app_list | 230 } // namespace app_list |
OLD | NEW |