diff options
author | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-15 04:53:37 +0000 |
---|---|---|
committer | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-15 04:53:37 +0000 |
commit | 30620c3be07fa1c0b90a04e9c7edd92f0351f71b (patch) | |
tree | 38c9e73584343c5b7b4cc1a7f5b2ff82422d21d8 /ash | |
parent | 760303690efe9d5520fcacd6b83144b9402720d0 (diff) | |
download | chromium_src-30620c3be07fa1c0b90a04e9c7edd92f0351f71b.zip chromium_src-30620c3be07fa1c0b90a04e9c7edd92f0351f71b.tar.gz chromium_src-30620c3be07fa1c0b90a04e9c7edd92f0351f71b.tar.bz2 |
disable passing null pointer to CalculateIdealBounds()
R=sky@chromium.org
BUG=NONE
Review URL: https://codereview.chromium.org/26971004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/launcher/launcher_view.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc index 70be9bb..4279c3c 100644 --- a/ash/launcher/launcher_view.cc +++ b/ash/launcher/launcher_view.cc @@ -794,11 +794,10 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) { else end_position = std::max(end_position, reserved_icon_space); - if (bounds) { - bounds->overflow_bounds.set_size(gfx::Size( - shelf->PrimaryAxisValue(w, width()), - shelf->PrimaryAxisValue(height(), h))); - } + bounds->overflow_bounds.set_size(gfx::Size( + shelf->PrimaryAxisValue(w, width()), + shelf->PrimaryAxisValue(height(), h))); + if (ash::switches::UseAlternateShelfLayout()) { last_visible_index_ = DetermineLastVisibleIndex( end_position - button_size); @@ -852,10 +851,8 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) { for (int i = first_panel_index; i <= last_hidden_index_; ++i) view_model_->set_ideal_bounds(i, gfx::Rect(x, y, w, h)); - if (bounds) { - bounds->overflow_bounds.set_x(x); - bounds->overflow_bounds.set_y(y); - } + bounds->overflow_bounds.set_x(x); + bounds->overflow_bounds.set_y(y); if (!ash::switches::UseAlternateShelfLayout()) { // Position app list after overflow button. gfx::Rect app_list_bounds = view_model_->ideal_bounds(last_button_index); @@ -1358,7 +1355,8 @@ int LauncherView::CancelDrag(int modified_index) { } gfx::Size LauncherView::GetPreferredSize() { - CalculateIdealBounds(NULL); + IdealBounds ideal_bounds; + CalculateIdealBounds(&ideal_bounds); ShelfLayoutManager* shelf = tooltip_->shelf_layout_manager(); const int preferred_size = shelf->GetPreferredShelfSize(); @@ -1421,7 +1419,8 @@ void LauncherView::LauncherItemAdded(int model_index) { // button before this animation completes it doesn't appear at some random // spot (because it was in the middle of animating from 0,0 0x0 to its // target). - CalculateIdealBounds(NULL); + IdealBounds ideal_bounds; + CalculateIdealBounds(&ideal_bounds); view->SetBoundsRect(view_model_->ideal_bounds(model_index)); // The first animation moves all the views to their target position. |view| |