| 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/gtk/extensions/media_galleries_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/media_gallery/media_galleries_preferences.h" | 9 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 11 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 11 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 12 #include "ui/base/gtk/gtk_hig_constants.h" | 13 #include "ui/base/gtk/gtk_hig_constants.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 14 | 15 |
| 15 namespace chrome { | 16 namespace chrome { |
| 16 | 17 |
| 17 typedef MediaGalleriesDialogController::KnownGalleryPermissions | 18 typedef MediaGalleriesDialogController::KnownGalleryPermissions |
| 18 GalleryPermissions; | 19 GalleryPermissions; |
| 19 | 20 |
| 20 MediaGalleriesDialogGtk::MediaGalleriesDialogGtk( | 21 MediaGalleriesDialogGtk::MediaGalleriesDialogGtk( |
| 21 MediaGalleriesDialogController* controller) | 22 MediaGalleriesDialogController* controller) |
| 22 : controller_(controller), | 23 : controller_(controller), |
| 23 window_(NULL), | 24 window_(NULL), |
| 24 confirm_(NULL), | 25 confirm_(NULL), |
| 25 checkbox_container_(NULL), | 26 checkbox_container_(NULL), |
| 26 ignore_toggles_(false), | 27 ignore_toggles_(false), |
| 27 accepted_(false) { | 28 accepted_(false) { |
| 28 InitWidgets(); | 29 InitWidgets(); |
| 29 | 30 |
| 30 // May be NULL during tests. | 31 // May be NULL during tests. |
| 31 if (controller->tab_contents()) | 32 if (controller->tab_contents()) { |
| 32 window_ = new ConstrainedWindowGtk(controller->tab_contents(), this); | 33 window_ = new ConstrainedWindowGtk( |
| 34 controller->tab_contents()->web_contents(), this); |
| 35 } |
| 33 } | 36 } |
| 34 | 37 |
| 35 MediaGalleriesDialogGtk::~MediaGalleriesDialogGtk() { | 38 MediaGalleriesDialogGtk::~MediaGalleriesDialogGtk() { |
| 36 } | 39 } |
| 37 | 40 |
| 38 void MediaGalleriesDialogGtk::InitWidgets() { | 41 void MediaGalleriesDialogGtk::InitWidgets() { |
| 39 contents_.Own(gtk_vbox_new(FALSE, ui::kContentAreaSpacing)); | 42 contents_.Own(gtk_vbox_new(FALSE, ui::kContentAreaSpacing)); |
| 40 | 43 |
| 41 GtkWidget* header = | 44 GtkWidget* header = |
| 42 gtk_util::CreateBoldLabel(UTF16ToUTF8(controller_->GetHeader())); | 45 gtk_util::CreateBoldLabel(UTF16ToUTF8(controller_->GetHeader())); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 164 |
| 162 // MediaGalleriesDialogController ---------------------------------------------- | 165 // MediaGalleriesDialogController ---------------------------------------------- |
| 163 | 166 |
| 164 // static | 167 // static |
| 165 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 168 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 166 MediaGalleriesDialogController* controller) { | 169 MediaGalleriesDialogController* controller) { |
| 167 return new MediaGalleriesDialogGtk(controller); | 170 return new MediaGalleriesDialogGtk(controller); |
| 168 } | 171 } |
| 169 | 172 |
| 170 } // namespace chrome | 173 } // namespace chrome |
| OLD | NEW |