| 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 "chrome/browser/ui/views/frame/immersive_context_mus.h" | 5 #include "chrome/browser/ui/views/frame/immersive_context_mus.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/capture_client.h" | 7 #include "services/ui/public/cpp/window_tree_client.h" |
| 8 #include "ui/views/mus/mus_client.h" | 8 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 9 #include "ui/views/mus/pointer_watcher_event_router2.h" | 9 #include "ui/views/mus/window_manager_connection.h" |
| 10 #include "ui/views/pointer_watcher.h" | 10 #include "ui/views/pointer_watcher.h" |
| 11 | 11 |
| 12 ImmersiveContextMus::ImmersiveContextMus( | 12 ImmersiveContextMus::ImmersiveContextMus() {} |
| 13 aura::client::CaptureClient* capture_client) | |
| 14 : capture_client_(capture_client) {} | |
| 15 | 13 |
| 16 ImmersiveContextMus::~ImmersiveContextMus() {} | 14 ImmersiveContextMus::~ImmersiveContextMus() {} |
| 17 | 15 |
| 18 void ImmersiveContextMus::InstallResizeHandleWindowTargeter( | 16 void ImmersiveContextMus::InstallResizeHandleWindowTargeter( |
| 19 ash::ImmersiveFullscreenController* controller) { | 17 ash::ImmersiveFullscreenController* controller) { |
| 20 // There shouldn't be a need to do anything here, the windowmanager takes care | 18 // There shouldn't be a need to do anything here, the windowmanager takes care |
| 21 // of this for us. | 19 // of this for us. |
| 22 } | 20 } |
| 23 | 21 |
| 24 void ImmersiveContextMus::OnEnteringOrExitingImmersive( | 22 void ImmersiveContextMus::OnEnteringOrExitingImmersive( |
| 25 ash::ImmersiveFullscreenController* controller, | 23 ash::ImmersiveFullscreenController* controller, |
| 26 bool entering) { | 24 bool entering) { |
| 27 // TODO: see implementation in ImmersiveContextAsh, this needs to use mojo | 25 // TODO: see implementation in ImmersiveContextAsh, this needs to use mojo |
| 28 // to poke some state in mash (shelf model, in immersive, shelf | 26 // to poke some state in mash (shelf model, in immersive, shelf |
| 29 // visibility...). | 27 // visibility...). |
| 30 // http://crbug.com/640371. | 28 // http://crbug.com/640371. |
| 31 NOTIMPLEMENTED(); | 29 NOTIMPLEMENTED(); |
| 32 } | 30 } |
| 33 | 31 |
| 34 gfx::Rect ImmersiveContextMus::GetDisplayBoundsInScreen(views::Widget* widget) { | 32 gfx::Rect ImmersiveContextMus::GetDisplayBoundsInScreen(views::Widget* widget) { |
| 35 return widget->GetWindowBoundsInScreen(); | 33 return widget->GetWindowBoundsInScreen(); |
| 36 } | 34 } |
| 37 | 35 |
| 38 void ImmersiveContextMus::AddPointerWatcher( | 36 void ImmersiveContextMus::AddPointerWatcher( |
| 39 views::PointerWatcher* watcher, | 37 views::PointerWatcher* watcher, |
| 40 views::PointerWatcherEventTypes events) { | 38 views::PointerWatcherEventTypes events) { |
| 41 // TODO: http://crbug.com/641164 | 39 // TODO: http://crbug.com/641164 |
| 42 views::MusClient::Get()->pointer_watcher_event_router()->AddPointerWatcher( | 40 views::WindowManagerConnection::Get() |
| 43 watcher, events == views::PointerWatcherEventTypes::MOVES); | 41 ->pointer_watcher_event_router() |
| 42 ->AddPointerWatcher(watcher, |
| 43 events == views::PointerWatcherEventTypes::MOVES); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void ImmersiveContextMus::RemovePointerWatcher(views::PointerWatcher* watcher) { | 46 void ImmersiveContextMus::RemovePointerWatcher(views::PointerWatcher* watcher) { |
| 47 views::MusClient::Get()->pointer_watcher_event_router()->RemovePointerWatcher( | 47 views::WindowManagerConnection::Get() |
| 48 watcher); | 48 ->pointer_watcher_event_router() |
| 49 ->RemovePointerWatcher(watcher); |
| 49 } | 50 } |
| 50 | 51 |
| 51 bool ImmersiveContextMus::DoesAnyWindowHaveCapture() { | 52 bool ImmersiveContextMus::DoesAnyWindowHaveCapture() { |
| 52 return capture_client_->GetGlobalCaptureWindow() != nullptr; | 53 return views::WindowManagerConnection::Get()->client()->GetCaptureWindow() != |
| 54 nullptr; |
| 53 } | 55 } |
| 54 | 56 |
| 55 bool ImmersiveContextMus::IsMouseEventsEnabled() { | 57 bool ImmersiveContextMus::IsMouseEventsEnabled() { |
| 56 // TODO: http://crbug.com/640374. | 58 // TODO: http://crbug.com/640374. |
| 57 NOTIMPLEMENTED(); | 59 NOTIMPLEMENTED(); |
| 58 return true; | 60 return true; |
| 59 } | 61 } |
| OLD | NEW |