| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 MediaGalleriesDialogController* controller) | 22 MediaGalleriesDialogController* controller) |
| 23 : controller_(controller), | 23 : controller_(controller), |
| 24 window_(NULL), | 24 window_(NULL), |
| 25 confirm_(NULL), | 25 confirm_(NULL), |
| 26 checkbox_container_(NULL), | 26 checkbox_container_(NULL), |
| 27 ignore_toggles_(false), | 27 ignore_toggles_(false), |
| 28 accepted_(false) { | 28 accepted_(false) { |
| 29 InitWidgets(); | 29 InitWidgets(); |
| 30 | 30 |
| 31 // May be NULL during tests. | 31 // May be NULL during tests. |
| 32 if (controller->tab_contents()) { | 32 if (controller->web_contents()) |
| 33 window_ = new ConstrainedWindowGtk( | 33 window_ = new ConstrainedWindowGtk(controller->web_contents(), this); |
| 34 controller->tab_contents()->web_contents(), this); | |
| 35 } | |
| 36 } | 34 } |
| 37 | 35 |
| 38 MediaGalleriesDialogGtk::~MediaGalleriesDialogGtk() { | 36 MediaGalleriesDialogGtk::~MediaGalleriesDialogGtk() { |
| 39 } | 37 } |
| 40 | 38 |
| 41 void MediaGalleriesDialogGtk::InitWidgets() { | 39 void MediaGalleriesDialogGtk::InitWidgets() { |
| 42 contents_.Own(gtk_vbox_new(FALSE, ui::kContentAreaSpacing)); | 40 contents_.Own(gtk_vbox_new(FALSE, ui::kContentAreaSpacing)); |
| 43 | 41 |
| 44 GtkWidget* header = | 42 GtkWidget* header = |
| 45 gtk_util::CreateBoldLabel(UTF16ToUTF8(controller_->GetHeader())); | 43 gtk_util::CreateBoldLabel(UTF16ToUTF8(controller_->GetHeader())); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 162 |
| 165 // MediaGalleriesDialogController ---------------------------------------------- | 163 // MediaGalleriesDialogController ---------------------------------------------- |
| 166 | 164 |
| 167 // static | 165 // static |
| 168 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 166 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 169 MediaGalleriesDialogController* controller) { | 167 MediaGalleriesDialogController* controller) { |
| 170 return new MediaGalleriesDialogGtk(controller); | 168 return new MediaGalleriesDialogGtk(controller); |
| 171 } | 169 } |
| 172 | 170 |
| 173 } // namespace chrome | 171 } // namespace chrome |
| OLD | NEW |