| 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 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 break; | 1836 break; |
| 1837 case SHELF_ALIGNMENT_LEFT: | 1837 case SHELF_ALIGNMENT_LEFT: |
| 1838 menu_alignment = views::MENU_ANCHOR_BUBBLE_RIGHT; | 1838 menu_alignment = views::MENU_ANCHOR_BUBBLE_RIGHT; |
| 1839 break; | 1839 break; |
| 1840 case SHELF_ALIGNMENT_RIGHT: | 1840 case SHELF_ALIGNMENT_RIGHT: |
| 1841 menu_alignment = views::MENU_ANCHOR_BUBBLE_LEFT; | 1841 menu_alignment = views::MENU_ANCHOR_BUBBLE_LEFT; |
| 1842 break; | 1842 break; |
| 1843 } | 1843 } |
| 1844 } | 1844 } |
| 1845 | 1845 |
| 1846 shelf_widget_->ForceUndimming(true); | |
| 1847 // NOTE: if you convert to HAS_MNEMONICS be sure to update menu building code. | 1846 // NOTE: if you convert to HAS_MNEMONICS be sure to update menu building code. |
| 1848 launcher_menu_runner_->RunMenuAt(source->GetWidget(), nullptr, anchor, | 1847 launcher_menu_runner_->RunMenuAt(source->GetWidget(), nullptr, anchor, |
| 1849 menu_alignment, source_type); | 1848 menu_alignment, source_type); |
| 1850 } | 1849 } |
| 1851 | 1850 |
| 1852 void ShelfView::OnMenuClosed(views::InkDrop* ink_drop) { | 1851 void ShelfView::OnMenuClosed(views::InkDrop* ink_drop) { |
| 1853 context_menu_id_ = 0; | 1852 context_menu_id_ = 0; |
| 1854 shelf_widget_->ForceUndimming(false); | |
| 1855 | 1853 |
| 1856 // Hide the hide overflow bubble after showing a context menu for its items. | 1854 // Hide the hide overflow bubble after showing a context menu for its items. |
| 1857 if (owner_overflow_bubble_) | 1855 if (owner_overflow_bubble_) |
| 1858 owner_overflow_bubble_->Hide(); | 1856 owner_overflow_bubble_->Hide(); |
| 1859 | 1857 |
| 1860 closing_event_time_ = launcher_menu_runner_->closing_event_time(); | 1858 closing_event_time_ = launcher_menu_runner_->closing_event_time(); |
| 1861 | 1859 |
| 1862 if (ink_drop) | 1860 if (ink_drop) |
| 1863 ink_drop->AnimateToState(views::InkDropState::DEACTIVATED); | 1861 ink_drop->AnimateToState(views::InkDropState::DEACTIVATED); |
| 1864 | 1862 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 | 1911 |
| 1914 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1912 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
| 1915 const gfx::Rect bounds = GetBoundsInScreen(); | 1913 const gfx::Rect bounds = GetBoundsInScreen(); |
| 1916 int distance = wm_shelf_->SelectValueForShelfAlignment( | 1914 int distance = wm_shelf_->SelectValueForShelfAlignment( |
| 1917 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1915 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
| 1918 bounds.x() - coordinate.x()); | 1916 bounds.x() - coordinate.x()); |
| 1919 return distance > 0 ? distance : 0; | 1917 return distance > 0 ? distance : 0; |
| 1920 } | 1918 } |
| 1921 | 1919 |
| 1922 } // namespace ash | 1920 } // namespace ash |
| OLD | NEW |