| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 AutoclickControllerCommon* autoclick_controller_common_; | 68 AutoclickControllerCommon* autoclick_controller_common_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(AutoclickUI); | 70 DISALLOW_COPY_AND_ASSIGN(AutoclickUI); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 AutoclickApplication::AutoclickApplication() | 73 AutoclickApplication::AutoclickApplication() |
| 74 : launchable_binding_(this), autoclick_binding_(this) {} | 74 : launchable_binding_(this), autoclick_binding_(this) {} |
| 75 | 75 |
| 76 AutoclickApplication::~AutoclickApplication() {} | 76 AutoclickApplication::~AutoclickApplication() {} |
| 77 | 77 |
| 78 void AutoclickApplication::OnStart(const service_manager::Identity& identity) { | 78 void AutoclickApplication::OnStart(const service_manager::ServiceInfo& info) { |
| 79 aura_init_.reset(new views::AuraInit(connector(), "views_mus_resources.pak")); | 79 aura_init_.reset(new views::AuraInit(connector(), "views_mus_resources.pak")); |
| 80 window_manager_connection_ = | 80 window_manager_connection_ = |
| 81 views::WindowManagerConnection::Create(connector(), identity); | 81 views::WindowManagerConnection::Create(connector(), info.identity); |
| 82 autoclick_controller_common_.reset(new AutoclickControllerCommon( | 82 autoclick_controller_common_.reset(new AutoclickControllerCommon( |
| 83 base::TimeDelta::FromMilliseconds(kDefaultAutoclickDelayMs), this)); | 83 base::TimeDelta::FromMilliseconds(kDefaultAutoclickDelayMs), this)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool AutoclickApplication::OnConnect( | 86 bool AutoclickApplication::OnConnect( |
| 87 const service_manager::Identity& remote_identity, | 87 const service_manager::ServiceInfo& remote_info, |
| 88 service_manager::InterfaceRegistry* registry) { | 88 service_manager::InterfaceRegistry* registry) { |
| 89 registry->AddInterface<mash::mojom::Launchable>(this); | 89 registry->AddInterface<mash::mojom::Launchable>(this); |
| 90 registry->AddInterface<mojom::AutoclickController>(this); | 90 registry->AddInterface<mojom::AutoclickController>(this); |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void AutoclickApplication::Launch(uint32_t what, mash::mojom::LaunchMode how) { | 94 void AutoclickApplication::Launch(uint32_t what, mash::mojom::LaunchMode how) { |
| 95 if (!widget_) { | 95 if (!widget_) { |
| 96 widget_.reset(new views::Widget); | 96 widget_.reset(new views::Widget); |
| 97 views::Widget::InitParams params( | 97 views::Widget::InitParams params( |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // TODO(riajiang): Currently not working. Need to know how to generate events | 156 // TODO(riajiang): Currently not working. Need to know how to generate events |
| 157 // in mus world (crbug.com/628665). | 157 // in mus world (crbug.com/628665). |
| 158 } | 158 } |
| 159 | 159 |
| 160 void AutoclickApplication::OnAutoclickCanceled() { | 160 void AutoclickApplication::OnAutoclickCanceled() { |
| 161 // Not used in mus. | 161 // Not used in mus. |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace autoclick | 164 } // namespace autoclick |
| 165 } // namespace ash | 165 } // namespace ash |
| OLD | NEW |