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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
9 #include "chrome/browser/ui/views/constrained_window_views.h" | 9 #include "chrome/browser/ui/views/constrained_window_views.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 accepted_(false), | 55 accepted_(false), |
56 // Enable this once chrome style constrained windows work on shell | 56 // Enable this once chrome style constrained windows work on shell |
57 // windows. http://crbug.com/156694 | 57 // windows. http://crbug.com/156694 |
58 enable_chrome_style_(CommandLine::ForCurrentProcess()->HasSwitch( | 58 enable_chrome_style_(CommandLine::ForCurrentProcess()->HasSwitch( |
59 switches::kEnableFramelessConstrainedDialogs)) { | 59 switches::kEnableFramelessConstrainedDialogs)) { |
60 InitChildViews(); | 60 InitChildViews(); |
61 | 61 |
62 // Ownership of |contents_| is handed off by this call. |window_| will take | 62 // Ownership of |contents_| is handed off by this call. |window_| will take |
63 // care of deleting itself after calling DeleteDelegate(). | 63 // care of deleting itself after calling DeleteDelegate(). |
64 window_ = new ConstrainedWindowViews( | 64 window_ = new ConstrainedWindowViews( |
65 controller->tab_contents()->web_contents(), this, | 65 controller->web_contents(), this, |
66 enable_chrome_style_, | 66 enable_chrome_style_, |
67 ConstrainedWindowViews::DEFAULT_INSETS); | 67 ConstrainedWindowViews::DEFAULT_INSETS); |
68 } | 68 } |
69 | 69 |
70 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() {} | 70 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() {} |
71 | 71 |
72 void MediaGalleriesDialogViews::InitChildViews() { | 72 void MediaGalleriesDialogViews::InitChildViews() { |
73 // Layout. | 73 // Layout. |
74 views::GridLayout* layout = new views::GridLayout(contents_); | 74 views::GridLayout* layout = new views::GridLayout(contents_); |
75 if (!enable_chrome_style_) { | 75 if (!enable_chrome_style_) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 // MediaGalleriesDialogViewsController ----------------------------------------- | 240 // MediaGalleriesDialogViewsController ----------------------------------------- |
241 | 241 |
242 // static | 242 // static |
243 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 243 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
244 MediaGalleriesDialogController* controller) { | 244 MediaGalleriesDialogController* controller) { |
245 return new MediaGalleriesDialogViews(controller); | 245 return new MediaGalleriesDialogViews(controller); |
246 } | 246 } |
247 | 247 |
248 } // namespace chrome | 248 } // namespace chrome |
OLD | NEW |