Chromium Code Reviews| Index: ui/views/widget/desktop_aura/desktop_capture_client.cc |
| diff --git a/ui/views/widget/desktop_aura/desktop_capture_client.cc b/ui/views/widget/desktop_aura/desktop_capture_client.cc |
| index 5ce64e9d025154dfaedc259308675d4446709e43..a86141b650a821fb32e8befd803fc28777702f34 100644 |
| --- a/ui/views/widget/desktop_aura/desktop_capture_client.cc |
| +++ b/ui/views/widget/desktop_aura/desktop_capture_client.cc |
| @@ -15,6 +15,15 @@ namespace views { |
| DesktopCaptureClient::CaptureClients* |
| DesktopCaptureClient::capture_clients_ = NULL; |
| +// static |
| +aura::Window* DesktopCaptureClient::GetCaptureWindowGlobal() { |
| + for (auto i = capture_clients_->begin(); i != capture_clients_->end(); ++i) { |
|
sadrul
2017/01/25 16:40:22
I was hoping something like this would work:
fo
|
| + if ((*i)->capture_window_) |
| + return (*i)->capture_window_; |
| + } |
| + return NULL; |
|
sadrul
2017/01/25 16:40:22
nullptr
|
| +} |
| + |
| DesktopCaptureClient::DesktopCaptureClient(aura::Window* root) |
| : root_(root), |
| capture_window_(NULL) { |
| @@ -90,12 +99,7 @@ aura::Window* DesktopCaptureClient::GetCaptureWindow() { |
| } |
| aura::Window* DesktopCaptureClient::GetGlobalCaptureWindow() { |
| - for (CaptureClients::iterator i = capture_clients_->begin(); |
| - i != capture_clients_->end(); ++i) { |
| - if ((*i)->capture_window_) |
| - return (*i)->capture_window_; |
| - } |
| - return NULL; |
| + return GetCaptureWindowGlobal(); |
| } |
| void DesktopCaptureClient::AddObserver( |