| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_dialog_views.h" | 5 #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" | 8 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 9 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 window_(NULL), | 71 window_(NULL), |
| 72 contents_(new views::View()), | 72 contents_(new views::View()), |
| 73 add_gallery_button_(NULL), | 73 add_gallery_button_(NULL), |
| 74 confirm_available_(false), | 74 confirm_available_(false), |
| 75 accepted_(false) { | 75 accepted_(false) { |
| 76 InitChildViews(); | 76 InitChildViews(); |
| 77 | 77 |
| 78 if (ControllerHasWebContents()) { | 78 if (ControllerHasWebContents()) { |
| 79 // Ownership of |contents_| is handed off by this call. |window_| will take | 79 // Ownership of |contents_| is handed off by this call. |window_| will take |
| 80 // care of deleting itself after calling DeleteDelegate(). | 80 // care of deleting itself after calling DeleteDelegate(). |
| 81 // TODO(gbillock): Use PopupManager here. |
| 81 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 82 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 82 WebContentsModalDialogManager::FromWebContents( | 83 WebContentsModalDialogManager::FromWebContents( |
| 83 controller->web_contents()); | 84 controller->web_contents()); |
| 84 DCHECK(web_contents_modal_dialog_manager); | 85 DCHECK(web_contents_modal_dialog_manager); |
| 85 WebContentsModalDialogManagerDelegate* modal_delegate = | 86 WebContentsModalDialogManagerDelegate* modal_delegate = |
| 86 web_contents_modal_dialog_manager->delegate(); | 87 web_contents_modal_dialog_manager->delegate(); |
| 87 DCHECK(modal_delegate); | 88 DCHECK(modal_delegate); |
| 88 window_ = views::Widget::CreateWindowAsFramelessChild( | 89 window_ = views::Widget::CreateWindowAsFramelessChild( |
| 89 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 90 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
| 90 web_contents_modal_dialog_manager->ShowModalDialog( | 91 web_contents_modal_dialog_manager->ShowModalDialog( |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 return controller_->web_contents() != NULL; | 340 return controller_->web_contents() != NULL; |
| 340 } | 341 } |
| 341 | 342 |
| 342 // MediaGalleriesDialogViewsController ----------------------------------------- | 343 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 343 | 344 |
| 344 // static | 345 // static |
| 345 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 346 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 346 MediaGalleriesDialogController* controller) { | 347 MediaGalleriesDialogController* controller) { |
| 347 return new MediaGalleriesDialogViews(controller); | 348 return new MediaGalleriesDialogViews(controller); |
| 348 } | 349 } |
| OLD | NEW |