Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: ash/common/shelf/shelf_view.cc

Issue 2477463003: Replace ui::AXViewState with AXNodeData and AXActionData (Closed)
Patch Set: Fix test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/shelf/shelf_view.h ('k') | ash/common/system/audio/volume_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11 matching lines...) Expand all
22 #include "ash/common/shelf/shelf_widget.h" 22 #include "ash/common/shelf/shelf_widget.h"
23 #include "ash/common/shelf/wm_shelf.h" 23 #include "ash/common/shelf/wm_shelf.h"
24 #include "ash/common/shell_delegate.h" 24 #include "ash/common/shell_delegate.h"
25 #include "ash/common/wm/root_window_finder.h" 25 #include "ash/common/wm/root_window_finder.h"
26 #include "ash/common/wm_lookup.h" 26 #include "ash/common/wm_lookup.h"
27 #include "ash/common/wm_shell.h" 27 #include "ash/common/wm_shell.h"
28 #include "ash/common/wm_window.h" 28 #include "ash/common/wm_window.h"
29 #include "base/auto_reset.h" 29 #include "base/auto_reset.h"
30 #include "base/metrics/histogram.h" 30 #include "base/metrics/histogram.h"
31 #include "grit/ash_strings.h" 31 #include "grit/ash_strings.h"
32 #include "ui/accessibility/ax_view_state.h" 32 #include "ui/accessibility/ax_node_data.h"
33 #include "ui/base/l10n/l10n_util.h" 33 #include "ui/base/l10n/l10n_util.h"
34 #include "ui/base/models/simple_menu_model.h" 34 #include "ui/base/models/simple_menu_model.h"
35 #include "ui/base/resource/resource_bundle.h" 35 #include "ui/base/resource/resource_bundle.h"
36 #include "ui/compositor/layer.h" 36 #include "ui/compositor/layer.h"
37 #include "ui/compositor/layer_animator.h" 37 #include "ui/compositor/layer_animator.h"
38 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 38 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
39 #include "ui/events/event_utils.h" 39 #include "ui/events/event_utils.h"
40 #include "ui/gfx/canvas.h" 40 #include "ui/gfx/canvas.h"
41 #include "ui/gfx/geometry/point.h" 41 #include "ui/gfx/geometry/point.h"
42 #include "ui/views/animation/bounds_animator.h" 42 #include "ui/views/animation/bounds_animator.h"
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 wm_shelf_->NotifyShelfIconPositionsChanged(); 1591 wm_shelf_->NotifyShelfIconPositionsChanged();
1592 1592
1593 if (IsShowingOverflowBubble()) 1593 if (IsShowingOverflowBubble())
1594 overflow_bubble_->Hide(); 1594 overflow_bubble_->Hide();
1595 } 1595 }
1596 1596
1597 views::FocusTraversable* ShelfView::GetPaneFocusTraversable() { 1597 views::FocusTraversable* ShelfView::GetPaneFocusTraversable() {
1598 return this; 1598 return this;
1599 } 1599 }
1600 1600
1601 void ShelfView::GetAccessibleState(ui::AXViewState* state) { 1601 void ShelfView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
1602 state->role = ui::AX_ROLE_TOOLBAR; 1602 node_data->role = ui::AX_ROLE_TOOLBAR;
1603 state->name = l10n_util::GetStringUTF16(IDS_ASH_SHELF_ACCESSIBLE_NAME); 1603 node_data->SetName(l10n_util::GetStringUTF8(IDS_ASH_SHELF_ACCESSIBLE_NAME));
1604 } 1604 }
1605 1605
1606 void ShelfView::ViewHierarchyChanged( 1606 void ShelfView::ViewHierarchyChanged(
1607 const ViewHierarchyChangedDetails& details) { 1607 const ViewHierarchyChangedDetails& details) {
1608 if (details.is_add && details.child == this) 1608 if (details.is_add && details.child == this)
1609 tooltip_.Init(); 1609 tooltip_.Init();
1610 } 1610 }
1611 1611
1612 void ShelfView::OnGestureEvent(ui::GestureEvent* event) { 1612 void ShelfView::OnGestureEvent(ui::GestureEvent* event) {
1613 if (wm_shelf_->ProcessGestureEvent(*event)) 1613 if (wm_shelf_->ProcessGestureEvent(*event))
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 1914
1915 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1915 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1916 const gfx::Rect bounds = GetBoundsInScreen(); 1916 const gfx::Rect bounds = GetBoundsInScreen();
1917 int distance = wm_shelf_->SelectValueForShelfAlignment( 1917 int distance = wm_shelf_->SelectValueForShelfAlignment(
1918 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1918 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1919 bounds.x() - coordinate.x()); 1919 bounds.x() - coordinate.x());
1920 return distance > 0 ? distance : 0; 1920 return distance > 0 ? distance : 0;
1921 } 1921 }
1922 1922
1923 } // namespace ash 1923 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_view.h ('k') | ash/common/system/audio/volume_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698