| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/touch_hud/mus/touch_hud_application.h" | 5 #include "ash/touch_hud/mus/touch_hud_application.h" |
| 6 | 6 |
| 7 #include "ash/public/interfaces/container.mojom.h" | 7 #include "ash/public/interfaces/container.mojom.h" |
| 8 #include "ash/touch_hud/touch_hud_renderer.h" | 8 #include "ash/touch_hud/touch_hud_renderer.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // receiving touch events from ui::WindowManagerConnection, it calls | 26 // receiving touch events from ui::WindowManagerConnection, it calls |
| 27 // ash::TouchHudRenderer to draw out touch points. | 27 // ash::TouchHudRenderer to draw out touch points. |
| 28 class TouchHudUI : public views::WidgetDelegateView, | 28 class TouchHudUI : public views::WidgetDelegateView, |
| 29 public views::PointerWatcher { | 29 public views::PointerWatcher { |
| 30 public: | 30 public: |
| 31 TouchHudUI(views::WindowManagerConnection* window_manager_connection, | 31 TouchHudUI(views::WindowManagerConnection* window_manager_connection, |
| 32 views::Widget* widget) | 32 views::Widget* widget) |
| 33 : window_manager_connection_(window_manager_connection), | 33 : window_manager_connection_(window_manager_connection), |
| 34 touch_hud_renderer_(new TouchHudRenderer(widget)) { | 34 touch_hud_renderer_(new TouchHudRenderer(widget)) { |
| 35 window_manager_connection_->pointer_watcher_event_router() | 35 window_manager_connection_->pointer_watcher_event_router() |
| 36 ->AddPointerWatcher(this, false /* want_moves */); | 36 ->AddPointerWatcher(this, true /* want_moves */); |
| 37 } | 37 } |
| 38 ~TouchHudUI() override { | 38 ~TouchHudUI() override { |
| 39 window_manager_connection_->pointer_watcher_event_router() | 39 window_manager_connection_->pointer_watcher_event_router() |
| 40 ->RemovePointerWatcher(this); | 40 ->RemovePointerWatcher(this); |
| 41 } | 41 } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Overridden from views::WidgetDelegate: | 44 // Overridden from views::WidgetDelegate: |
| 45 views::View* GetContentsView() override { return this; } | 45 views::View* GetContentsView() override { return this; } |
| 46 base::string16 GetWindowTitle() const override { | 46 base::string16 GetWindowTitle() const override { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 widget_->Init(params); | 101 widget_->Init(params); |
| 102 widget_->Show(); | 102 widget_->Show(); |
| 103 } else { | 103 } else { |
| 104 widget_->Close(); | 104 widget_->Close(); |
| 105 base::MessageLoop::current()->QuitWhenIdle(); | 105 base::MessageLoop::current()->QuitWhenIdle(); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void TouchHudApplication::Create(const shell::Identity& remote_identity, | 109 void TouchHudApplication::Create(const shell::Identity& remote_identity, |
| 110 mash::mojom::LaunchableRequest request) { | 110 mash::mojom::LaunchableRequest request) { |
| 111 binding_.Close(); |
| 111 binding_.Bind(std::move(request)); | 112 binding_.Bind(std::move(request)); |
| 112 } | 113 } |
| 113 | 114 |
| 114 } // namespace touch_hud | 115 } // namespace touch_hud |
| 115 } // namespace ash | 116 } // namespace ash |
| OLD | NEW |