| 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/autoclick/mus/autoclick_application.h" | 5 #include "ash/autoclick/mus/autoclick_application.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 11 #include "services/service_manager/public/cpp/connector.h" |
| 11 #include "services/ui/public/cpp/property_type_converters.h" | 12 #include "services/ui/public/cpp/property_type_converters.h" |
| 12 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 13 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 13 #include "ui/views/mus/aura_init.h" | 14 #include "ui/views/mus/aura_init.h" |
| 14 #include "ui/views/mus/native_widget_mus.h" | 15 #include "ui/views/mus/native_widget_mus.h" |
| 15 #include "ui/views/mus/pointer_watcher_event_router.h" | 16 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 16 #include "ui/views/mus/window_manager_connection.h" | 17 #include "ui/views/mus/window_manager_connection.h" |
| 17 #include "ui/views/pointer_watcher.h" | 18 #include "ui/views/pointer_watcher.h" |
| 18 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(AutoclickUI); | 71 DISALLOW_COPY_AND_ASSIGN(AutoclickUI); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 AutoclickApplication::AutoclickApplication() | 74 AutoclickApplication::AutoclickApplication() |
| 74 : launchable_binding_(this), autoclick_binding_(this) {} | 75 : launchable_binding_(this), autoclick_binding_(this) {} |
| 75 | 76 |
| 76 AutoclickApplication::~AutoclickApplication() {} | 77 AutoclickApplication::~AutoclickApplication() {} |
| 77 | 78 |
| 78 void AutoclickApplication::OnStart(const service_manager::ServiceInfo& info) { | 79 void AutoclickApplication::OnStart(const service_manager::ServiceInfo& info) { |
| 79 aura_init_.reset(new views::AuraInit(connector(), "views_mus_resources.pak")); | 80 aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity, |
| 81 "views_mus_resources.pak"); |
| 80 window_manager_connection_ = | 82 window_manager_connection_ = |
| 81 views::WindowManagerConnection::Create(connector(), info.identity); | 83 views::WindowManagerConnection::Create(connector(), info.identity); |
| 82 autoclick_controller_common_.reset(new AutoclickControllerCommon( | 84 autoclick_controller_common_.reset(new AutoclickControllerCommon( |
| 83 base::TimeDelta::FromMilliseconds(kDefaultAutoclickDelayMs), this)); | 85 base::TimeDelta::FromMilliseconds(kDefaultAutoclickDelayMs), this)); |
| 84 } | 86 } |
| 85 | 87 |
| 86 bool AutoclickApplication::OnConnect( | 88 bool AutoclickApplication::OnConnect( |
| 87 const service_manager::ServiceInfo& remote_info, | 89 const service_manager::ServiceInfo& remote_info, |
| 88 service_manager::InterfaceRegistry* registry) { | 90 service_manager::InterfaceRegistry* registry) { |
| 89 registry->AddInterface<mash::mojom::Launchable>(this); | 91 registry->AddInterface<mash::mojom::Launchable>(this); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // TODO(riajiang): Currently not working. Need to know how to generate events | 158 // TODO(riajiang): Currently not working. Need to know how to generate events |
| 157 // in mus world (crbug.com/628665). | 159 // in mus world (crbug.com/628665). |
| 158 } | 160 } |
| 159 | 161 |
| 160 void AutoclickApplication::OnAutoclickCanceled() { | 162 void AutoclickApplication::OnAutoclickCanceled() { |
| 161 // Not used in mus. | 163 // Not used in mus. |
| 162 } | 164 } |
| 163 | 165 |
| 164 } // namespace autoclick | 166 } // namespace autoclick |
| 165 } // namespace ash | 167 } // namespace ash |
| OLD | NEW |