Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc

Issue 2700083002: Views/Harmony: Use LayoutDelegate::GetMetric() for views::kPanelHorizMargin. (Closed)
Patch Set: Review comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" 11 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h"
12 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
12 #include "chrome/grit/generated_resources.h" 13 #include "chrome/grit/generated_resources.h"
13 #include "chrome/grit/locale_settings.h" 14 #include "chrome/grit/locale_settings.h"
14 #include "components/constrained_window/constrained_window_views.h" 15 #include "components/constrained_window/constrained_window_views.h"
15 #include "components/web_modal/web_contents_modal_dialog_manager.h" 16 #include "components/web_modal/web_contents_modal_dialog_manager.h"
16 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
17 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/native_theme/native_theme.h" 19 #include "ui/native_theme/native_theme.h"
19 #include "ui/views/border.h" 20 #include "ui/views/border.h"
20 #include "ui/views/controls/button/checkbox.h" 21 #include "ui/views/controls/button/checkbox.h"
21 #include "ui/views/controls/button/image_button.h" 22 #include "ui/views/controls/button/image_button.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 139
139 // Header and separator line. 140 // Header and separator line.
140 if (!section_headers[i].empty() && !entries.empty()) { 141 if (!section_headers[i].empty() && !entries.empty()) {
141 views::Separator* separator = new views::Separator(); 142 views::Separator* separator = new views::Separator();
142 scroll_container->AddChildView(separator); 143 scroll_container->AddChildView(separator);
143 144
144 views::Label* header = new views::Label(section_headers[i]); 145 views::Label* header = new views::Label(section_headers[i]);
145 header->SetMultiLine(true); 146 header->SetMultiLine(true);
146 header->SetHorizontalAlignment(gfx::ALIGN_LEFT); 147 header->SetHorizontalAlignment(gfx::ALIGN_LEFT);
147 header->SetBorder(views::CreateEmptyBorder( 148 header->SetBorder(views::CreateEmptyBorder(
148 views::kRelatedControlVerticalSpacing, views::kPanelHorizMargin, 149 views::kRelatedControlVerticalSpacing,
150 LayoutDelegate::Get()->GetMetric(
151 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN),
149 views::kRelatedControlVerticalSpacing, 0)); 152 views::kRelatedControlVerticalSpacing, 0));
150 scroll_container->AddChildView(header); 153 scroll_container->AddChildView(header);
151 } 154 }
152 155
153 // Checkboxes. 156 // Checkboxes.
154 MediaGalleriesDialogController::Entries::const_iterator iter; 157 MediaGalleriesDialogController::Entries::const_iterator iter;
155 for (iter = entries.begin(); iter != entries.end(); ++iter) { 158 for (iter = entries.begin(); iter != entries.end(); ++iter) {
156 int spacing = 0; 159 int spacing = 0;
157 if (iter + 1 == entries.end()) 160 if (iter + 1 == entries.end())
158 spacing = views::kRelatedControlSmallVerticalSpacing; 161 spacing = views::kRelatedControlSmallVerticalSpacing;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 context_menu_runner_.reset(); 323 context_menu_runner_.reset();
321 } 324 }
322 325
323 // MediaGalleriesDialogViewsController ----------------------------------------- 326 // MediaGalleriesDialogViewsController -----------------------------------------
324 327
325 // static 328 // static
326 MediaGalleriesDialog* MediaGalleriesDialog::Create( 329 MediaGalleriesDialog* MediaGalleriesDialog::Create(
327 MediaGalleriesDialogController* controller) { 330 MediaGalleriesDialogController* controller) {
328 return new MediaGalleriesDialogViews(controller); 331 return new MediaGalleriesDialogViews(controller);
329 } 332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698