| 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/common/shelf/shelf_view.h" | 5 #include "ash/common/shelf/shelf_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
| (...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 launcher_menu_runner_->RunMenuAt(source->GetWidget(), nullptr, anchor, | 1858 launcher_menu_runner_->RunMenuAt(source->GetWidget(), nullptr, anchor, |
| 1859 menu_alignment, source_type); | 1859 menu_alignment, source_type); |
| 1860 } | 1860 } |
| 1861 | 1861 |
| 1862 void ShelfView::OnMenuClosed(views::InkDrop* ink_drop) { | 1862 void ShelfView::OnMenuClosed(views::InkDrop* ink_drop) { |
| 1863 context_menu_id_ = 0; | 1863 context_menu_id_ = 0; |
| 1864 shelf_widget_->ForceUndimming(false); | 1864 shelf_widget_->ForceUndimming(false); |
| 1865 | 1865 |
| 1866 // Hide the hide overflow bubble after showing a context menu for its items. | 1866 // Hide the hide overflow bubble after showing a context menu for its items. |
| 1867 if (owner_overflow_bubble_) | 1867 if (owner_overflow_bubble_) |
| 1868 owner_overflow_bubble_->HideBubbleAndRefreshButton(); | 1868 owner_overflow_bubble_->Hide(); |
| 1869 | 1869 |
| 1870 closing_event_time_ = launcher_menu_runner_->closing_event_time(); | 1870 closing_event_time_ = launcher_menu_runner_->closing_event_time(); |
| 1871 | 1871 |
| 1872 if (ink_drop) | 1872 if (ink_drop) |
| 1873 ink_drop->AnimateToState(views::InkDropState::DEACTIVATED); | 1873 ink_drop->AnimateToState(views::InkDropState::DEACTIVATED); |
| 1874 | 1874 |
| 1875 launcher_menu_runner_.reset(); | 1875 launcher_menu_runner_.reset(); |
| 1876 menu_model_adapter_.reset(); | 1876 menu_model_adapter_.reset(); |
| 1877 menu_model_.reset(); | 1877 menu_model_.reset(); |
| 1878 scoped_root_window_for_new_windows_.reset(); | 1878 scoped_root_window_for_new_windows_.reset(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 | 1924 |
| 1925 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1925 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
| 1926 const gfx::Rect bounds = GetBoundsInScreen(); | 1926 const gfx::Rect bounds = GetBoundsInScreen(); |
| 1927 int distance = wm_shelf_->SelectValueForShelfAlignment( | 1927 int distance = wm_shelf_->SelectValueForShelfAlignment( |
| 1928 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1928 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
| 1929 bounds.x() - coordinate.x()); | 1929 bounds.x() - coordinate.x()); |
| 1930 return distance > 0 ? distance : 0; | 1930 return distance > 0 ? distance : 0; |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 } // namespace ash | 1933 } // namespace ash |
| OLD | NEW |