| OLD | NEW |
| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 void ShelfView::OnShelfAlignmentChanged() { | 429 void ShelfView::OnShelfAlignmentChanged() { |
| 430 overflow_button_->OnShelfAlignmentChanged(); | 430 overflow_button_->OnShelfAlignmentChanged(); |
| 431 LayoutToIdealBounds(); | 431 LayoutToIdealBounds(); |
| 432 for (int i = 0; i < view_model_->view_size(); ++i) { | 432 for (int i = 0; i < view_model_->view_size(); ++i) { |
| 433 if (i >= first_visible_index_ && i <= last_visible_index_) | 433 if (i >= first_visible_index_ && i <= last_visible_index_) |
| 434 view_model_->view_at(i)->Layout(); | 434 view_model_->view_at(i)->Layout(); |
| 435 } | 435 } |
| 436 tooltip_.Close(); | 436 tooltip_.Close(); |
| 437 if (overflow_bubble_) | 437 if (overflow_bubble_) |
| 438 overflow_bubble_->Hide(); | 438 overflow_bubble_->Hide(); |
| 439 // For crbug.com/587931, because AppListButton layout logic is in OnPaint. |
| 440 views::View* app_list_button = GetAppListButtonView(); |
| 441 if (app_list_button) |
| 442 app_list_button->SchedulePaint(); |
| 439 } | 443 } |
| 440 | 444 |
| 441 void ShelfView::SchedulePaintForAllButtons() { | 445 void ShelfView::SchedulePaintForAllButtons() { |
| 442 for (int i = 0; i < view_model_->view_size(); ++i) { | 446 for (int i = 0; i < view_model_->view_size(); ++i) { |
| 443 if (i >= first_visible_index_ && i <= last_visible_index_) | 447 if (i >= first_visible_index_ && i <= last_visible_index_) |
| 444 view_model_->view_at(i)->SchedulePaint(); | 448 view_model_->view_at(i)->SchedulePaint(); |
| 445 } | 449 } |
| 446 if (overflow_button_ && overflow_button_->visible()) | 450 if (overflow_button_ && overflow_button_->visible()) |
| 447 overflow_button_->SchedulePaint(); | 451 overflow_button_->SchedulePaint(); |
| 448 } | 452 } |
| (...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 | 1885 |
| 1882 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1886 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
| 1883 const gfx::Rect bounds = GetBoundsInScreen(); | 1887 const gfx::Rect bounds = GetBoundsInScreen(); |
| 1884 int distance = shelf_->SelectValueForShelfAlignment( | 1888 int distance = shelf_->SelectValueForShelfAlignment( |
| 1885 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1889 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
| 1886 bounds.x() - coordinate.x()); | 1890 bounds.x() - coordinate.x()); |
| 1887 return distance > 0 ? distance : 0; | 1891 return distance > 0 ? distance : 0; |
| 1888 } | 1892 } |
| 1889 | 1893 |
| 1890 } // namespace ash | 1894 } // namespace ash |
| OLD | NEW |