Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: ui/app_list/views/apps_grid_view.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/apps_grid_view.h ('k') | ui/app_list/views/contents_switcher_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/app_list/views/apps_grid_view.h" 5 #include "ui/app_list/views/apps_grid_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 for (int i = start; i < end; i++) { 834 for (int i = start; i < end; i++) {
835 AppListItemView* v = static_cast<AppListItemView*>(view_model_.view_at(i)); 835 AppListItemView* v = static_cast<AppListItemView*>(view_model_.view_at(i));
836 v->Prerender(); 836 v->Prerender();
837 } 837 }
838 } 838 }
839 839
840 bool AppsGridView::IsAnimatingView(views::View* view) { 840 bool AppsGridView::IsAnimatingView(views::View* view) {
841 return bounds_animator_.IsAnimating(view); 841 return bounds_animator_.IsAnimating(view);
842 } 842 }
843 843
844 gfx::Size AppsGridView::GetPreferredSize() { 844 gfx::Size AppsGridView::GetPreferredSize() const {
845 const gfx::Insets insets(GetInsets()); 845 const gfx::Insets insets(GetInsets());
846 const gfx::Size tile_size = gfx::Size(kPreferredTileWidth, 846 const gfx::Size tile_size = gfx::Size(kPreferredTileWidth,
847 kPreferredTileHeight); 847 kPreferredTileHeight);
848 const int page_switcher_height = 848 const int page_switcher_height =
849 page_switcher_view_->GetPreferredSize().height(); 849 page_switcher_view_->GetPreferredSize().height();
850 return gfx::Size( 850 return gfx::Size(
851 tile_size.width() * cols_ + insets.width(), 851 tile_size.width() * cols_ + insets.width(),
852 tile_size.height() * rows_per_page_ + 852 tile_size.height() * rows_per_page_ +
853 page_switcher_height + insets.height()); 853 page_switcher_height + insets.height());
854 } 854 }
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, 2148 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index,
2149 bool is_target_folder) { 2149 bool is_target_folder) {
2150 AppListItemView* target_view = 2150 AppListItemView* target_view =
2151 static_cast<AppListItemView*>( 2151 static_cast<AppListItemView*>(
2152 GetViewAtSlotOnCurrentPage(target_index.slot)); 2152 GetViewAtSlotOnCurrentPage(target_index.slot));
2153 if (target_view) 2153 if (target_view)
2154 target_view->SetAsAttemptedFolderTarget(is_target_folder); 2154 target_view->SetAsAttemptedFolderTarget(is_target_folder);
2155 } 2155 }
2156 2156
2157 } // namespace app_list 2157 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/apps_grid_view.h ('k') | ui/app_list/views/contents_switcher_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698