| 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/system/tray/tray_background_view.h" | 5 #include "ash/common/system/tray/tray_background_view.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/shelf/shelf_constants.h" | 8 #include "ash/common/shelf/shelf_constants.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
| 11 #include "ash/common/system/status_area_widget.h" | 11 #include "ash/common/system/status_area_widget.h" |
| 12 #include "ash/common/system/tray/system_tray.h" | 12 #include "ash/common/system/tray/system_tray.h" |
| 13 #include "ash/common/system/tray/tray_constants.h" | 13 #include "ash/common/system/tray/tray_constants.h" |
| 14 #include "ash/common/system/tray/tray_event_filter.h" | 14 #include "ash/common/system/tray/tray_event_filter.h" |
| 15 #include "ash/common/wm_lookup.h" | 15 #include "ash/common/wm_lookup.h" |
| 16 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 17 #include "ash/common/wm_window.h" | 17 #include "ash/common/wm_window.h" |
| 18 #include "ash/public/cpp/shell_window_ids.h" | 18 #include "ash/public/cpp/shell_window_ids.h" |
| 19 #include "grit/ash_resources.h" | 19 #include "grit/ash_resources.h" |
| 20 #include "ui/accessibility/ax_view_state.h" | 20 #include "ui/accessibility/ax_node_data.h" |
| 21 #include "ui/base/nine_image_painter_factory.h" | 21 #include "ui/base/nine_image_painter_factory.h" |
| 22 #include "ui/compositor/layer.h" | 22 #include "ui/compositor/layer.h" |
| 23 #include "ui/compositor/layer_animation_element.h" | 23 #include "ui/compositor/layer_animation_element.h" |
| 24 #include "ui/compositor/scoped_layer_animation_settings.h" | 24 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 25 #include "ui/events/event_constants.h" | 25 #include "ui/events/event_constants.h" |
| 26 #include "ui/gfx/animation/tween.h" | 26 #include "ui/gfx/animation/tween.h" |
| 27 #include "ui/gfx/canvas.h" | 27 #include "ui/gfx/canvas.h" |
| 28 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
| 29 #include "ui/gfx/geometry/size.h" | 29 #include "ui/gfx/geometry/size.h" |
| 30 #include "ui/gfx/image/image_skia.h" | 30 #include "ui/gfx/image/image_skia.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 } | 345 } |
| 346 | 346 |
| 347 const char* TrayBackgroundView::GetClassName() const { | 347 const char* TrayBackgroundView::GetClassName() const { |
| 348 return kViewClassName; | 348 return kViewClassName; |
| 349 } | 349 } |
| 350 | 350 |
| 351 void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { | 351 void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { |
| 352 PreferredSizeChanged(); | 352 PreferredSizeChanged(); |
| 353 } | 353 } |
| 354 | 354 |
| 355 void TrayBackgroundView::GetAccessibleState(ui::AXViewState* state) { | 355 void TrayBackgroundView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 356 ActionableView::GetAccessibleState(state); | 356 ActionableView::GetAccessibleNodeData(node_data); |
| 357 state->name = GetAccessibleNameForTray(); | 357 node_data->SetName(GetAccessibleNameForTray()); |
| 358 } | 358 } |
| 359 | 359 |
| 360 void TrayBackgroundView::AboutToRequestFocusFromTabTraversal(bool reverse) { | 360 void TrayBackgroundView::AboutToRequestFocusFromTabTraversal(bool reverse) { |
| 361 // Return focus to the login view. See crbug.com/120500. | 361 // Return focus to the login view. See crbug.com/120500. |
| 362 views::View* v = GetNextFocusableView(); | 362 views::View* v = GetNextFocusableView(); |
| 363 if (v) | 363 if (v) |
| 364 v->AboutToRequestFocusFromTabTraversal(reverse); | 364 v->AboutToRequestFocusFromTabTraversal(reverse); |
| 365 } | 365 } |
| 366 | 366 |
| 367 bool TrayBackgroundView::PerformAction(const ui::Event& event) { | 367 bool TrayBackgroundView::PerformAction(const ui::Event& event) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 paint.setAntiAlias(true); | 566 paint.setAntiAlias(true); |
| 567 | 567 |
| 568 const gfx::Rect bounds = horizontal_shelf ? gfx::Rect(x, y, width, height) | 568 const gfx::Rect bounds = horizontal_shelf ? gfx::Rect(x, y, width, height) |
| 569 : gfx::Rect(y, x, height, width); | 569 : gfx::Rect(y, x, height, width); |
| 570 gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale)); | 570 gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale)); |
| 571 canvas->DrawLine(horizontal_shelf ? rect.top_right() : rect.bottom_left(), | 571 canvas->DrawLine(horizontal_shelf ? rect.top_right() : rect.bottom_left(), |
| 572 rect.bottom_right(), paint); | 572 rect.bottom_right(), paint); |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace ash | 575 } // namespace ash |
| OLD | NEW |