| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // Header and separator line. | 141 // Header and separator line. |
| 142 if (!section_headers[i].empty() && !entries.empty()) { | 142 if (!section_headers[i].empty() && !entries.empty()) { |
| 143 views::Separator* separator = new views::Separator(); | 143 views::Separator* separator = new views::Separator(); |
| 144 scroll_container->AddChildView(separator); | 144 scroll_container->AddChildView(separator); |
| 145 | 145 |
| 146 views::Label* header = new views::Label(section_headers[i]); | 146 views::Label* header = new views::Label(section_headers[i]); |
| 147 header->SetMultiLine(true); | 147 header->SetMultiLine(true); |
| 148 header->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 148 header->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 149 header->SetBorder(views::CreateEmptyBorder( | 149 header->SetBorder(views::CreateEmptyBorder( |
| 150 vertical_padding, | 150 vertical_padding, |
| 151 provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN), | 151 provider->GetDistanceMetric( |
| 152 views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN), |
| 152 vertical_padding, 0)); | 153 vertical_padding, 0)); |
| 153 scroll_container->AddChildView(header); | 154 scroll_container->AddChildView(header); |
| 154 } | 155 } |
| 155 | 156 |
| 156 // Checkboxes. | 157 // Checkboxes. |
| 157 MediaGalleriesDialogController::Entries::const_iterator iter; | 158 MediaGalleriesDialogController::Entries::const_iterator iter; |
| 158 for (iter = entries.begin(); iter != entries.end(); ++iter) { | 159 for (iter = entries.begin(); iter != entries.end(); ++iter) { |
| 159 int spacing = iter + 1 == entries.end() ? small_vertical_padding : 0; | 160 int spacing = iter + 1 == entries.end() ? small_vertical_padding : 0; |
| 160 AddOrUpdateGallery(*iter, scroll_container, spacing); | 161 AddOrUpdateGallery(*iter, scroll_container, spacing); |
| 161 } | 162 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 context_menu_runner_.reset(); | 320 context_menu_runner_.reset(); |
| 320 } | 321 } |
| 321 | 322 |
| 322 // MediaGalleriesDialogViewsController ----------------------------------------- | 323 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 323 | 324 |
| 324 // static | 325 // static |
| 325 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 326 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 326 MediaGalleriesDialogController* controller) { | 327 MediaGalleriesDialogController* controller) { |
| 327 return new MediaGalleriesDialogViews(controller); | 328 return new MediaGalleriesDialogViews(controller); |
| 328 } | 329 } |
| OLD | NEW |