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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 void FolderHeaderView::OnPaint(gfx::Canvas* canvas) { | 195 void FolderHeaderView::OnPaint(gfx::Canvas* canvas) { |
196 views::View::OnPaint(canvas); | 196 views::View::OnPaint(canvas); |
197 | 197 |
198 gfx::Rect rect(GetContentsBounds()); | 198 gfx::Rect rect(GetContentsBounds()); |
199 if (rect.IsEmpty() || !folder_name_visible_) | 199 if (rect.IsEmpty() || !folder_name_visible_) |
200 return; | 200 return; |
201 | 201 |
202 // Draw bottom separator line. | 202 // Draw bottom separator line. |
203 int horizontal_padding = app_list::switches::IsExperimentalAppListEnabled() | 203 int horizontal_padding = app_list::switches::IsExperimentalAppListEnabled() |
204 ? kExperimentalWindowPadding | 204 ? kExperimentalAppsGridPadding |
205 : kBottomSeparatorPadding; | 205 : kBottomSeparatorPadding; |
206 rect.Inset(horizontal_padding, 0); | 206 rect.Inset(horizontal_padding, 0); |
207 rect.set_y(rect.bottom() - kBottomSeparatorHeight); | 207 rect.set_y(rect.bottom() - kBottomSeparatorHeight); |
208 rect.set_height(kBottomSeparatorHeight); | 208 rect.set_height(kBottomSeparatorHeight); |
209 canvas->FillRect(rect, kTopSeparatorColor); | 209 canvas->FillRect(rect, kTopSeparatorColor); |
210 } | 210 } |
211 | 211 |
212 void FolderHeaderView::ContentsChanged(views::Textfield* sender, | 212 void FolderHeaderView::ContentsChanged(views::Textfield* sender, |
213 const base::string16& new_contents) { | 213 const base::string16& new_contents) { |
214 // Temporarily remove from observer to ignore data change caused by us. | 214 // Temporarily remove from observer to ignore data change caused by us. |
(...skipping 16 matching lines...) Expand all Loading... |
231 void FolderHeaderView::ButtonPressed(views::Button* sender, | 231 void FolderHeaderView::ButtonPressed(views::Button* sender, |
232 const ui::Event& event) { | 232 const ui::Event& event) { |
233 delegate_->NavigateBack(folder_item_, event); | 233 delegate_->NavigateBack(folder_item_, event); |
234 } | 234 } |
235 | 235 |
236 void FolderHeaderView::ItemNameChanged() { | 236 void FolderHeaderView::ItemNameChanged() { |
237 Update(); | 237 Update(); |
238 } | 238 } |
239 | 239 |
240 } // namespace app_list | 240 } // namespace app_list |
OLD | NEW |