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

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

Issue 2888563004: Delete panel metrics and define insets in terms of distance metrics. (Closed)
Patch Set: one wrong conversion Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_gallery_checkbox_view.h" 5 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h"
6 6
7 #include "chrome/browser/media_galleries/media_galleries_preferences.h" 7 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
8 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" 8 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 13 matching lines...) Expand all
24 24
25 MediaGalleryCheckboxView::MediaGalleryCheckboxView( 25 MediaGalleryCheckboxView::MediaGalleryCheckboxView(
26 const MediaGalleryPrefInfo& pref_info, 26 const MediaGalleryPrefInfo& pref_info,
27 int trailing_vertical_space, 27 int trailing_vertical_space,
28 views::ButtonListener* button_listener, 28 views::ButtonListener* button_listener,
29 views::ContextMenuController* menu_controller) { 29 views::ContextMenuController* menu_controller) {
30 DCHECK(button_listener != NULL); 30 DCHECK(button_listener != NULL);
31 SetLayoutManager( 31 SetLayoutManager(
32 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); 32 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
33 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); 33 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
34 const int border_horiz_margin = 34 const int border_horiz_margin = provider->GetDistanceMetric(
35 provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN); 35 views::DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN);
36 SetBorder(views::CreateEmptyBorder( 36 SetBorder(views::CreateEmptyBorder(
37 0, border_horiz_margin, trailing_vertical_space, border_horiz_margin)); 37 0, border_horiz_margin, trailing_vertical_space, border_horiz_margin));
38 if (menu_controller) 38 if (menu_controller)
39 set_context_menu_controller(menu_controller); 39 set_context_menu_controller(menu_controller);
40 40
41 checkbox_ = new views::Checkbox(pref_info.GetGalleryDisplayName()); 41 checkbox_ = new views::Checkbox(pref_info.GetGalleryDisplayName());
42 checkbox_->set_listener(button_listener); 42 checkbox_->set_listener(button_listener);
43 if (menu_controller) 43 if (menu_controller)
44 checkbox_->set_context_menu_controller(menu_controller); 44 checkbox_->set_context_menu_controller(menu_controller);
45 checkbox_->SetElideBehavior(gfx::ELIDE_MIDDLE); 45 checkbox_->SetElideBehavior(gfx::ELIDE_MIDDLE);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 std::max(area.width() / 2, area.width() - checkbox_width); 84 std::max(area.width() / 2, area.width() - checkbox_width);
85 } 85 }
86 checkbox_width = area.width() - secondary_text_width; 86 checkbox_width = area.width() - secondary_text_width;
87 87
88 checkbox_->SetBounds(area.x(), area.y(), checkbox_width, area.height()); 88 checkbox_->SetBounds(area.x(), area.y(), checkbox_width, area.height());
89 if (secondary_text_->visible()) { 89 if (secondary_text_->visible()) {
90 secondary_text_->SetBounds(checkbox_->x() + checkbox_width, area.y(), 90 secondary_text_->SetBounds(checkbox_->x() + checkbox_width, area.y(),
91 secondary_text_width, area.height()); 91 secondary_text_width, area.height());
92 } 92 }
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698