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

Side by Side Diff: chrome/browser/ui/views/extensions/media_galleries_scan_result_dialog_views.cc

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make PopupManager a thin API for WCMDM Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/media_galleries_scan_result_dialog_ views.h" 5 #include "chrome/browser/ui/views/extensions/media_galleries_scan_result_dialog_ views.h"
6 6
7 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" 7 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h" 8 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h" 9 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 MediaGalleriesScanResultDialogViews::MediaGalleriesScanResultDialogViews( 62 MediaGalleriesScanResultDialogViews::MediaGalleriesScanResultDialogViews(
63 MediaGalleriesScanResultDialogController* controller) 63 MediaGalleriesScanResultDialogController* controller)
64 : controller_(controller), 64 : controller_(controller),
65 window_(NULL), 65 window_(NULL),
66 contents_(new views::View()), 66 contents_(new views::View()),
67 accepted_(false) { 67 accepted_(false) {
68 InitChildViews(); 68 InitChildViews();
69 69
70 // Ownership of |contents_| is handed off by this call. |window_| will take 70 // Ownership of |contents_| is handed off by this call. |window_| will take
71 // care of deleting itself after calling DeleteDelegate(). 71 // care of deleting itself after calling DeleteDelegate().
72 // TODO(gbillock): Use PopupManager here.
72 web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager = 73 web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager =
73 web_modal::WebContentsModalDialogManager::FromWebContents( 74 web_modal::WebContentsModalDialogManager::FromWebContents(
74 controller->web_contents()); 75 controller->web_contents());
75 DCHECK(web_contents_modal_dialog_manager); 76 DCHECK(web_contents_modal_dialog_manager);
76 web_modal::WebContentsModalDialogManagerDelegate* modal_delegate = 77 web_modal::WebContentsModalDialogManagerDelegate* modal_delegate =
77 web_contents_modal_dialog_manager->delegate(); 78 web_contents_modal_dialog_manager->delegate();
78 DCHECK(modal_delegate); 79 DCHECK(modal_delegate);
79 window_ = views::Widget::CreateWindowAsFramelessChild( 80 window_ = views::Widget::CreateWindowAsFramelessChild(
80 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); 81 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView());
81 web_contents_modal_dialog_manager->ShowModalDialog( 82 web_contents_modal_dialog_manager->ShowModalDialog(
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 web_contents_modal_dialog_manager).CloseAllDialogs(); 295 web_contents_modal_dialog_manager).CloseAllDialogs();
295 } 296 }
296 297
297 // MediaGalleriesScanResultDialogViewsController ------------------------------- 298 // MediaGalleriesScanResultDialogViewsController -------------------------------
298 299
299 // static 300 // static
300 MediaGalleriesScanResultDialog* MediaGalleriesScanResultDialog::Create( 301 MediaGalleriesScanResultDialog* MediaGalleriesScanResultDialog::Create(
301 MediaGalleriesScanResultDialogController* controller) { 302 MediaGalleriesScanResultDialogController* controller) {
302 return new MediaGalleriesScanResultDialogViews(controller); 303 return new MediaGalleriesScanResultDialogViews(controller);
303 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698