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

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 2901503003: Rename GetPreferredSize to CalculatePreferredSize in ash/ (Closed)
Patch Set: Created 3 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
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 "ash/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 : nullptr; 1390 : nullptr;
1391 model_->Move(drag_view_index, start_drag_index_); 1391 model_->Move(drag_view_index, start_drag_index_);
1392 1392
1393 // If the modified view will be at the end of the list, return the new end of 1393 // If the modified view will be at the end of the list, return the new end of
1394 // the list. 1394 // the list.
1395 if (at_end) 1395 if (at_end)
1396 return view_model_->view_size(); 1396 return view_model_->view_size();
1397 return modified_view ? view_model_->GetIndexOfView(modified_view) : -1; 1397 return modified_view ? view_model_->GetIndexOfView(modified_view) : -1;
1398 } 1398 }
1399 1399
1400 gfx::Size ShelfView::GetPreferredSize() const { 1400 gfx::Size ShelfView::CalculatePreferredSize() const {
1401 gfx::Rect overflow_bounds; 1401 gfx::Rect overflow_bounds;
1402 CalculateIdealBounds(&overflow_bounds); 1402 CalculateIdealBounds(&overflow_bounds);
1403 1403
1404 int last_button_index = last_visible_index_; 1404 int last_button_index = last_visible_index_;
1405 if (!is_overflow_mode()) { 1405 if (!is_overflow_mode()) {
1406 if (last_hidden_index_ < view_model_->view_size() - 1) 1406 if (last_hidden_index_ < view_model_->view_size() - 1)
1407 last_button_index = view_model_->view_size() - 1; 1407 last_button_index = view_model_->view_size() - 1;
1408 else if (overflow_button_ && overflow_button_->visible()) 1408 else if (overflow_button_ && overflow_button_->visible())
1409 last_button_index++; 1409 last_button_index++;
1410 } 1410 }
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 if (pointer == TOUCH && 1826 if (pointer == TOUCH &&
1827 (base::TimeTicks::Now() - touch_press_time_) < 1827 (base::TimeTicks::Now() - touch_press_time_) <
1828 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) { 1828 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) {
1829 return false; 1829 return false;
1830 } 1830 }
1831 1831
1832 return true; 1832 return true;
1833 } 1833 }
1834 1834
1835 } // namespace ash 1835 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | ash/shell/lock_view.cc » ('j') | ash/shell/lock_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698