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

Side by Side Diff: chrome/browser/ui/views/arc_app_dialog_view.cc

Issue 2713803002: Views/Harmony: Use LayoutDelegate::GetMetric for views::kPanelVertMargin. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/app_list/arc/arc_app_dialog.h" 5 #include "chrome/browser/ui/app_list/arc/arc_app_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_util.h" 10 #include "chrome/browser/extensions/extension_util.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
13 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" 13 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h"
14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
15 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 15 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
16 #include "chrome/browser/ui/native_window_tracker.h" 16 #include "chrome/browser/ui/native_window_tracker.h"
17 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
17 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
18 #include "components/constrained_window/constrained_window_views.h" 19 #include "components/constrained_window/constrained_window_views.h"
19 #include "components/strings/grit/components_strings.h" 20 #include "components/strings/grit/components_strings.h"
20 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
21 #include "ui/base/ui_base_types.h" 22 #include "ui/base/ui_base_types.h"
22 #include "ui/views/controls/image_view.h" 23 #include "ui/views/controls/image_view.h"
23 #include "ui/views/controls/label.h" 24 #include "ui/views/controls/label.h"
24 #include "ui/views/layout/box_layout.h" 25 #include "ui/views/layout/box_layout.h"
25 #include "ui/views/layout/layout_constants.h" 26 #include "ui/views/layout/layout_constants.h"
26 #include "ui/views/view.h" 27 #include "ui/views/view.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 confirm_button_text_(confirm_button_text), 133 confirm_button_text_(confirm_button_text),
133 cancel_button_text_(cancel_button_text), 134 cancel_button_text_(cancel_button_text),
134 confirm_callback_(confirm_callback) { 135 confirm_callback_(confirm_callback) {
135 DCHECK(controller); 136 DCHECK(controller);
136 parent_ = controller_->GetAppListWindow(); 137 parent_ = controller_->GetAppListWindow();
137 if (parent_) 138 if (parent_)
138 parent_window_tracker_ = NativeWindowTracker::Create(parent_); 139 parent_window_tracker_ = NativeWindowTracker::Create(parent_);
139 140
140 SetLayoutManager(new views::BoxLayout( 141 SetLayoutManager(new views::BoxLayout(
141 views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew, 142 views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew,
142 views::kPanelVertMargin, views::kRelatedControlHorizontalSpacing)); 143 LayoutDelegate::Get()->GetMetric(
144 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN),
145 views::kRelatedControlHorizontalSpacing));
143 146
144 icon_view_ = new FixedBoundarySizeImageView(); 147 icon_view_ = new FixedBoundarySizeImageView();
145 AddChildView(icon_view_); 148 AddChildView(icon_view_);
146 149
147 views::View* text_container = new views::View(); 150 views::View* text_container = new views::View();
148 views::BoxLayout* text_container_layout = 151 views::BoxLayout* text_container_layout =
149 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); 152 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
150 text_container_layout->set_main_axis_alignment( 153 text_container_layout->set_main_axis_alignment(
151 views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); 154 views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
152 text_container_layout->set_cross_axis_alignment( 155 text_container_layout->set_cross_axis_alignment(
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 291
289 bool CloseAppDialogViewAndConfirmForTest(bool confirm) { 292 bool CloseAppDialogViewAndConfirmForTest(bool confirm) {
290 if (!g_current_arc_app_dialog_view) 293 if (!g_current_arc_app_dialog_view)
291 return false; 294 return false;
292 295
293 g_current_arc_app_dialog_view->ConfirmOrCancelForTest(confirm); 296 g_current_arc_app_dialog_view->ConfirmOrCancelForTest(confirm);
294 return true; 297 return true;
295 } 298 }
296 299
297 } // namespace arc 300 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698