Chromium Code Reviews| 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 "ui/views/mus/mus_client.h" | 5 #include "ui/views/mus/mus_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h" | 10 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 } else { | 214 } else { |
| 215 std::map<std::string, std::vector<uint8_t>> mus_properties = | 215 std::map<std::string, std::vector<uint8_t>> mus_properties = |
| 216 ConfigurePropertiesFromParams(init_params); | 216 ConfigurePropertiesFromParams(init_params); |
| 217 native_widget->SetDesktopWindowTreeHost( | 217 native_widget->SetDesktopWindowTreeHost( |
| 218 base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget, | 218 base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget, |
| 219 &mus_properties)); | 219 &mus_properties)); |
| 220 } | 220 } |
| 221 return native_widget; | 221 return native_widget; |
| 222 } | 222 } |
| 223 | 223 |
| 224 void MusClient::OnCaptureClientSet( | |
| 225 aura::client::CaptureClient* capture_client) { | |
| 226 capture_client->AddObserver(pointer_watcher_event_router_.get()); | |
| 227 window_tree_client_->OnCaptureClientSet(capture_client); | |
|
sadrul
2017/01/27 01:06:54
Maybe do:
pointer_watcher_event_router_->Attach
riajiang
2017/01/30 18:36:22
Sure that makes sense. Changed to expose capture_s
| |
| 228 } | |
| 229 | |
| 230 void MusClient::OnCaptureClientUnset( | |
| 231 aura::client::CaptureClient* capture_client) { | |
| 232 capture_client->RemoveObserver(pointer_watcher_event_router_.get()); | |
| 233 window_tree_client_->OnCaptureClientUnset(capture_client); | |
| 234 } | |
| 235 | |
| 224 void MusClient::AddObserver(MusClientObserver* observer) { | 236 void MusClient::AddObserver(MusClientObserver* observer) { |
| 225 observer_list_.AddObserver(observer); | 237 observer_list_.AddObserver(observer); |
| 226 } | 238 } |
| 227 | 239 |
| 228 void MusClient::RemoveObserver(MusClientObserver* observer) { | 240 void MusClient::RemoveObserver(MusClientObserver* observer) { |
| 229 observer_list_.RemoveObserver(observer); | 241 observer_list_.RemoveObserver(observer); |
| 230 } | 242 } |
| 231 | 243 |
| 232 void MusClient::OnEmbed( | 244 void MusClient::OnEmbed( |
| 233 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { | 245 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 return root->GetTopWindowContainingPoint(relative_point); | 284 return root->GetTopWindowContainingPoint(relative_point); |
| 273 } | 285 } |
| 274 return nullptr; | 286 return nullptr; |
| 275 } | 287 } |
| 276 | 288 |
| 277 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { | 289 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { |
| 278 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 290 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
| 279 } | 291 } |
| 280 | 292 |
| 281 } // namespace views | 293 } // namespace views |
| OLD | NEW |