| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/ui/browser_dialogs.h" |
| 11 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" | 12 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" |
| 12 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 13 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| 13 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
| 14 #include "chrome/grit/locale_settings.h" | 15 #include "chrome/grit/locale_settings.h" |
| 15 #include "components/constrained_window/constrained_window_views.h" | 16 #include "components/constrained_window/constrained_window_views.h" |
| 16 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 17 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 17 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/native_theme/native_theme.h" | 20 #include "ui/native_theme/native_theme.h" |
| 20 #include "ui/views/border.h" | 21 #include "ui/views/border.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 : controller_(controller), | 68 : controller_(controller), |
| 68 contents_(new views::View()), | 69 contents_(new views::View()), |
| 69 auxiliary_button_(NULL), | 70 auxiliary_button_(NULL), |
| 70 confirm_available_(false), | 71 confirm_available_(false), |
| 71 accepted_(false) { | 72 accepted_(false) { |
| 72 InitChildViews(); | 73 InitChildViews(); |
| 73 if (ControllerHasWebContents()) { | 74 if (ControllerHasWebContents()) { |
| 74 constrained_window::ShowWebModalDialogViews(this, | 75 constrained_window::ShowWebModalDialogViews(this, |
| 75 controller->WebContents()); | 76 controller->WebContents()); |
| 76 } | 77 } |
| 78 chrome::RecordDialogCreation(chrome::DialogIdentifier::MEDIA_GALLERIES); |
| 77 } | 79 } |
| 78 | 80 |
| 79 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() { | 81 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() { |
| 80 if (!ControllerHasWebContents()) | 82 if (!ControllerHasWebContents()) |
| 81 delete contents_; | 83 delete contents_; |
| 82 } | 84 } |
| 83 | 85 |
| 84 void MediaGalleriesDialogViews::AcceptDialogForTesting() { | 86 void MediaGalleriesDialogViews::AcceptDialogForTesting() { |
| 85 accepted_ = true; | 87 accepted_ = true; |
| 86 | 88 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 context_menu_runner_.reset(); | 321 context_menu_runner_.reset(); |
| 320 } | 322 } |
| 321 | 323 |
| 322 // MediaGalleriesDialogViewsController ----------------------------------------- | 324 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 323 | 325 |
| 324 // static | 326 // static |
| 325 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 327 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 326 MediaGalleriesDialogController* controller) { | 328 MediaGalleriesDialogController* controller) { |
| 327 return new MediaGalleriesDialogViews(controller); | 329 return new MediaGalleriesDialogViews(controller); |
| 328 } | 330 } |
| OLD | NEW |