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/wm/gestures/long_press_affordance_handler.h" | 5 #include "ash/wm/gestures/long_press_affordance_handler.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const SkColor kAffordanceArcColor = SkColorSetARGB(80, 0, 0, 0); | 58 const SkColor kAffordanceArcColor = SkColorSetARGB(80, 0, 0, 0); |
59 const int kAffordanceFrameRateHz = 60; | 59 const int kAffordanceFrameRateHz = 60; |
60 | 60 |
61 views::Widget* CreateAffordanceWidget(aura::RootWindow* root_window) { | 61 views::Widget* CreateAffordanceWidget(aura::RootWindow* root_window) { |
62 views::Widget* widget = new views::Widget; | 62 views::Widget* widget = new views::Widget; |
63 views::Widget::InitParams params; | 63 views::Widget::InitParams params; |
64 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 64 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
65 params.keep_on_top = true; | 65 params.keep_on_top = true; |
66 params.accept_events = false; | 66 params.accept_events = false; |
67 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 67 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 68 params.context = root_window; |
68 params.transparent = true; | 69 params.transparent = true; |
69 widget->Init(params); | 70 widget->Init(params); |
70 widget->SetOpacity(0xFF); | 71 widget->SetOpacity(0xFF); |
71 ash::GetRootWindowController(root_window)->GetContainer( | 72 ash::GetRootWindowController(root_window)->GetContainer( |
72 ash::internal::kShellWindowId_OverlayContainer)->AddChild( | 73 ash::internal::kShellWindowId_OverlayContainer)->AddChild( |
73 widget->GetNativeWindow()); | 74 widget->GetNativeWindow()); |
74 return widget; | 75 return widget; |
75 } | 76 } |
76 | 77 |
77 void PaintAffordanceArc(gfx::Canvas* canvas, | 78 void PaintAffordanceArc(gfx::Canvas* canvas, |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 default: | 370 default: |
370 view_.reset(); | 371 view_.reset(); |
371 tap_down_touch_id_ = -1; | 372 tap_down_touch_id_ = -1; |
372 tap_down_display_id_ = 0; | 373 tap_down_display_id_ = 0; |
373 break; | 374 break; |
374 } | 375 } |
375 } | 376 } |
376 | 377 |
377 } // namespace internal | 378 } // namespace internal |
378 } // namespace ash | 379 } // namespace ash |
OLD | NEW |