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 "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Enable this once chrome style constrained windows work on shell | 44 // Enable this once chrome style constrained windows work on shell |
45 // windows. http://crbug.com/156694 | 45 // windows. http://crbug.com/156694 |
46 enable_chrome_style_(UseChromeStyleDialogs()) { | 46 enable_chrome_style_(UseChromeStyleDialogs()) { |
47 InitChildViews(); | 47 InitChildViews(); |
48 | 48 |
49 // Ownership of |contents_| is handed off by this call. |window_| will take | 49 // Ownership of |contents_| is handed off by this call. |window_| will take |
50 // care of deleting itself after calling DeleteDelegate(). | 50 // care of deleting itself after calling DeleteDelegate(). |
51 window_ = new ConstrainedWindowViews( | 51 window_ = new ConstrainedWindowViews( |
52 controller->web_contents(), this, | 52 controller->web_contents(), this, |
53 enable_chrome_style_, | 53 enable_chrome_style_, |
54 ConstrainedWindowViews::DEFAULT_INSETS); | 54 ConstrainedWindowViews::FRAME_LAYOUT_FULL); |
55 } | 55 } |
56 | 56 |
57 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() {} | 57 MediaGalleriesDialogViews::~MediaGalleriesDialogViews() {} |
58 | 58 |
59 void MediaGalleriesDialogViews::InitChildViews() { | 59 void MediaGalleriesDialogViews::InitChildViews() { |
60 // Layout. | 60 // Layout. |
61 views::GridLayout* layout = new views::GridLayout(contents_); | 61 views::GridLayout* layout = new views::GridLayout(contents_); |
62 if (!enable_chrome_style_) { | 62 if (!enable_chrome_style_) { |
63 layout->SetInsets(views::kPanelVertMargin, views::kPanelHorizMargin, | 63 layout->SetInsets(views::kPanelVertMargin, views::kPanelHorizMargin, |
64 0, views::kPanelHorizMargin); | 64 0, views::kPanelHorizMargin); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 // MediaGalleriesDialogViewsController ----------------------------------------- | 226 // MediaGalleriesDialogViewsController ----------------------------------------- |
227 | 227 |
228 // static | 228 // static |
229 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 229 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
230 MediaGalleriesDialogController* controller) { | 230 MediaGalleriesDialogController* controller) { |
231 return new MediaGalleriesDialogViews(controller); | 231 return new MediaGalleriesDialogViews(controller); |
232 } | 232 } |
233 | 233 |
234 } // namespace chrome | 234 } // namespace chrome |
OLD | NEW |