| 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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 return this; | 1502 return this; |
| 1503 } | 1503 } |
| 1504 | 1504 |
| 1505 void ShelfView::GetAccessibleState(ui::AXViewState* state) { | 1505 void ShelfView::GetAccessibleState(ui::AXViewState* state) { |
| 1506 state->role = ui::AX_ROLE_TOOLBAR; | 1506 state->role = ui::AX_ROLE_TOOLBAR; |
| 1507 state->name = l10n_util::GetStringUTF16(IDS_ASH_SHELF_ACCESSIBLE_NAME); | 1507 state->name = l10n_util::GetStringUTF16(IDS_ASH_SHELF_ACCESSIBLE_NAME); |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 void ShelfView::ViewHierarchyChanged( | 1510 void ShelfView::ViewHierarchyChanged( |
| 1511 const ViewHierarchyChangedDetails& details) { | 1511 const ViewHierarchyChangedDetails& details) { |
| 1512 if (details.is_add && details.child == this && GetWidget()) | 1512 if (details.is_add && details.child == this) |
| 1513 tooltip_.Init(); | 1513 tooltip_.Init(); |
| 1514 } | 1514 } |
| 1515 | 1515 |
| 1516 void ShelfView::OnGestureEvent(ui::GestureEvent* event) { | 1516 void ShelfView::OnGestureEvent(ui::GestureEvent* event) { |
| 1517 aura::Window* target_window = static_cast<views::View*>(event->target()) | 1517 aura::Window* target_window = static_cast<views::View*>(event->target()) |
| 1518 ->GetWidget() | 1518 ->GetWidget() |
| 1519 ->GetNativeWindow(); | 1519 ->GetNativeWindow(); |
| 1520 if (gesture_handler_.ProcessGestureEvent(*event, target_window)) | 1520 if (gesture_handler_.ProcessGestureEvent(*event, target_window)) |
| 1521 event->StopPropagation(); | 1521 event->StopPropagation(); |
| 1522 } | 1522 } |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1876 | 1876 |
| 1877 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1877 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
| 1878 const gfx::Rect bounds = GetBoundsInScreen(); | 1878 const gfx::Rect bounds = GetBoundsInScreen(); |
| 1879 int distance = shelf_->SelectValueForShelfAlignment( | 1879 int distance = shelf_->SelectValueForShelfAlignment( |
| 1880 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1880 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
| 1881 bounds.x() - coordinate.x()); | 1881 bounds.x() - coordinate.x()); |
| 1882 return distance > 0 ? distance : 0; | 1882 return distance > 0 ? distance : 0; |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 } // namespace ash | 1885 } // namespace ash |
| OLD | NEW |