Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/widget/desktop_aura/desktop_capture_client.h" | 5 #include "ui/views/widget/desktop_aura/desktop_capture_client.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_event_dispatcher.h" | 8 #include "ui/aura/window_event_dispatcher.h" |
| 9 #include "ui/aura/window_tracker.h" | 9 #include "ui/aura/window_tracker.h" |
| 10 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 DesktopCaptureClient::CaptureClients* | 15 DesktopCaptureClient::CaptureClients* |
| 16 DesktopCaptureClient::capture_clients_ = NULL; | 16 DesktopCaptureClient::capture_clients_ = NULL; |
| 17 | 17 |
| 18 // static | |
| 19 aura::Window* DesktopCaptureClient::GetCaptureWindowGlobal() { | |
| 20 for (CaptureClients::iterator i = capture_clients_->begin(); | |
| 21 i != capture_clients_->end(); ++i) { | |
|
sadrul
2017/01/25 05:34:27
Use auto
| |
| 22 if ((*i)->capture_window_) | |
| 23 return (*i)->capture_window_; | |
| 24 } | |
| 25 return NULL; | |
| 26 } | |
| 27 | |
| 18 DesktopCaptureClient::DesktopCaptureClient(aura::Window* root) | 28 DesktopCaptureClient::DesktopCaptureClient(aura::Window* root) |
| 19 : root_(root), | 29 : root_(root), |
| 20 capture_window_(NULL) { | 30 capture_window_(NULL) { |
| 21 if (!capture_clients_) | 31 if (!capture_clients_) |
| 22 capture_clients_ = new CaptureClients; | 32 capture_clients_ = new CaptureClients; |
| 23 capture_clients_->insert(this); | 33 capture_clients_->insert(this); |
| 24 aura::client::SetCaptureClient(root, this); | 34 aura::client::SetCaptureClient(root, this); |
| 25 } | 35 } |
| 26 | 36 |
| 27 DesktopCaptureClient::~DesktopCaptureClient() { | 37 DesktopCaptureClient::~DesktopCaptureClient() { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 if (capture_window_ != window) | 93 if (capture_window_ != window) |
| 84 return; | 94 return; |
| 85 SetCapture(NULL); | 95 SetCapture(NULL); |
| 86 } | 96 } |
| 87 | 97 |
| 88 aura::Window* DesktopCaptureClient::GetCaptureWindow() { | 98 aura::Window* DesktopCaptureClient::GetCaptureWindow() { |
| 89 return capture_window_; | 99 return capture_window_; |
| 90 } | 100 } |
| 91 | 101 |
| 92 aura::Window* DesktopCaptureClient::GetGlobalCaptureWindow() { | 102 aura::Window* DesktopCaptureClient::GetGlobalCaptureWindow() { |
| 93 for (CaptureClients::iterator i = capture_clients_->begin(); | 103 return GetCaptureWindowGlobal(); |
| 94 i != capture_clients_->end(); ++i) { | |
| 95 if ((*i)->capture_window_) | |
| 96 return (*i)->capture_window_; | |
| 97 } | |
| 98 return NULL; | |
| 99 } | 104 } |
| 100 | 105 |
| 101 void DesktopCaptureClient::AddObserver( | 106 void DesktopCaptureClient::AddObserver( |
| 102 aura::client::CaptureClientObserver* observer) { | 107 aura::client::CaptureClientObserver* observer) { |
| 103 NOTREACHED(); | 108 NOTREACHED(); |
| 104 } | 109 } |
| 105 | 110 |
| 106 void DesktopCaptureClient::RemoveObserver( | 111 void DesktopCaptureClient::RemoveObserver( |
| 107 aura::client::CaptureClientObserver* observer) { | 112 aura::client::CaptureClientObserver* observer) { |
| 108 NOTREACHED(); | 113 NOTREACHED(); |
| 109 } | 114 } |
| 110 | 115 |
| 111 } // namespace views | 116 } // namespace views |
| OLD | NEW |