Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(987)

Unified Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc

Issue 2428383008: Bug Fix: Desktop Capture Picker Not Modal (Closed)
Patch Set: Fix by comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
index 049a56b160d31a5e43666ae27df96f09b104d758..f6ecd5986f05c8e2a69425fbe67cd842ff600ce6 100644
--- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
+++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
@@ -17,6 +17,8 @@
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/webrtc/native_desktop_media_list.h"
#include "chrome/browser/media/webrtc/tab_desktop_media_list.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_window.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@@ -116,8 +118,13 @@ bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute(
return false;
}
- const gfx::NativeWindow parent_window =
- web_contents->GetTopLevelNativeWindow();
+ gfx::NativeWindow parent_window = web_contents->GetTopLevelNativeWindow();
+ if (!parent_window) {
Sergey Ulanov 2016/10/26 17:08:08 Please add a comment here to explain why we need t
qiangchen 2016/10/26 18:39:17 Done.
+ Browser* target_browser = chrome::FindLastActive();
Sergey Ulanov 2016/10/26 17:08:08 I think it's best to use chrome::FindLastActiveWit
qiangchen 2016/10/26 18:39:17 Done.
+
+ if (target_browser)
+ parent_window = target_browser->window()->GetNativeWindow();
+ }
std::unique_ptr<DesktopMediaList> screen_list;
std::unique_ptr<DesktopMediaList> window_list;
std::unique_ptr<DesktopMediaList> tab_list;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698