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

Side by Side Diff: chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc

Issue 2617613002: Bring Aura Window To Front When Sharing (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h" 5 #include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/media/webrtc/desktop_media_list.h" 9 #include "chrome/browser/media/webrtc/desktop_media_list.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 content::WebContents* tab = content::WebContents::FromRenderFrameHost( 330 content::WebContents* tab = content::WebContents::FromRenderFrameHost(
331 content::RenderFrameHost::FromID( 331 content::RenderFrameHost::FromID(
332 source.web_contents_id.render_process_id, 332 source.web_contents_id.render_process_id,
333 source.web_contents_id.main_render_frame_id)); 333 source.web_contents_id.main_render_frame_id));
334 if (tab) { 334 if (tab) {
335 tab->GetDelegate()->ActivateContents(tab); 335 tab->GetDelegate()->ActivateContents(tab);
336 Browser* browser = chrome::FindBrowserWithWebContents(tab); 336 Browser* browser = chrome::FindBrowserWithWebContents(tab);
337 if (browser && browser->window()) 337 if (browser && browser->window())
338 browser->window()->Activate(); 338 browser->window()->Activate();
339 } 339 }
340 } else if (source.type == DesktopMediaID::TYPE_WINDOW) {
341 #if defined(USE_AURA)
342 aura::Window* window = DesktopMediaID::GetAuraWindowById(source);
343 Browser* browser = chrome::FindBrowserWithWindow(window);
msw 2017/01/05 01:20:31 q: Can we just call window->Activate() instead?
qiangchen 2017/01/05 16:34:36 No. aura::Window does not provide such functionali
344 if (browser && browser->window())
345 browser->window()->Activate();
346 #endif
340 } 347 }
341 348
342 if (parent_) 349 if (parent_)
343 parent_->NotifyDialogResult(source); 350 parent_->NotifyDialogResult(source);
344 351
345 // Return true to close the window. 352 // Return true to close the window.
346 return true; 353 return true;
347 } 354 }
348 355
349 void DesktopMediaPickerDialogView::DeleteDelegate() { 356 void DesktopMediaPickerDialogView::DeleteDelegate() {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 452
446 // static 453 // static
447 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { 454 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
448 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 455 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
449 extensions::switches::kDisableDesktopCapturePickerNewUI)) { 456 extensions::switches::kDisableDesktopCapturePickerNewUI)) {
450 return std::unique_ptr<DesktopMediaPicker>( 457 return std::unique_ptr<DesktopMediaPicker>(
451 new deprecated::DesktopMediaPickerViews()); 458 new deprecated::DesktopMediaPickerViews());
452 } 459 }
453 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); 460 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
454 } 461 }
OLDNEW
« 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