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 "chrome/browser/ui/tab_contents/tab_contents.h" | 7 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
8 #include "chrome/browser/ui/views/constrained_window_views.h" | 8 #include "chrome/browser/ui/views/constrained_window_views.h" |
9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
10 #include "grit/locale_settings.h" | 10 #include "grit/locale_settings.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 window_(NULL), | 48 window_(NULL), |
49 contents_(new views::View()), | 49 contents_(new views::View()), |
50 checkbox_container_(NULL), | 50 checkbox_container_(NULL), |
51 add_gallery_container_(NULL), | 51 add_gallery_container_(NULL), |
52 confirm_available_(false), | 52 confirm_available_(false), |
53 accepted_(false) { | 53 accepted_(false) { |
54 InitChildViews(); | 54 InitChildViews(); |
55 | 55 |
56 // Ownership of |contents_| is handed off by this call. |window_| will take | 56 // Ownership of |contents_| is handed off by this call. |window_| will take |
57 // care of deleting itself after calling DeleteDelegate(). | 57 // care of deleting itself after calling DeleteDelegate(). |
58 window_ = new ConstrainedWindowViews( | 58 window_ = new ConstrainedWindowViews(controller->web_contents(), this, false); |
59 controller->tab_contents()->web_contents(), this, false); | |
60 } | 59 } |
61 | 60 |
62 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() {} | 61 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() {} |
63 | 62 |
64 void MediaGalleriesDialogViews::InitChildViews() { | 63 void MediaGalleriesDialogViews::InitChildViews() { |
65 // Layout. | 64 // Layout. |
66 views::GridLayout* layout = new views::GridLayout(contents_); | 65 views::GridLayout* layout = new views::GridLayout(contents_); |
67 layout->SetInsets(views::kPanelVertMargin, views::kPanelHorizMargin, | 66 layout->SetInsets(views::kPanelVertMargin, views::kPanelHorizMargin, |
68 0, views::kPanelHorizMargin); | 67 0, views::kPanelHorizMargin); |
69 int column_set_id = 0; | 68 int column_set_id = 0; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 214 |
216 // MediaGalleriesDialogViewsController ----------------------------------------- | 215 // MediaGalleriesDialogViewsController ----------------------------------------- |
217 | 216 |
218 // static | 217 // static |
219 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 218 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
220 MediaGalleriesDialogController* controller) { | 219 MediaGalleriesDialogController* controller) { |
221 return new MediaGalleriesDialogViews(controller); | 220 return new MediaGalleriesDialogViews(controller); |
222 } | 221 } |
223 | 222 |
224 } // namespace chrome | 223 } // namespace chrome |
OLD | NEW |