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

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

Issue 2779973003: views: fold layout_utils::CreatePanelLayout into GridLayout::CreatePanel (Closed)
Patch Set: remove old DEPS entry Created 3 years, 8 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/create_application_shortcut_view.h" 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 description_->SetText(text); 136 description_->SetText(text);
137 } else { 137 } else {
138 description_ = new views::Label(text); 138 description_ = new views::Label(text);
139 description_->SetMultiLine(true); 139 description_->SetMultiLine(true);
140 description_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 140 description_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
141 } 141 }
142 } 142 }
143 143
144 void AppInfoView::SetupLayout() { 144 void AppInfoView::SetupLayout() {
145 views::GridLayout* layout = views::GridLayout::CreatePanel(this); 145 views::GridLayout* layout = views::GridLayout::CreatePanel(this);
146 SetLayoutManager(layout);
147 146
148 static const int kColumnSetId = 0; 147 static const int kColumnSetId = 0;
149 views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); 148 views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId);
150 column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::LEADING, 149 column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::LEADING,
151 20.0f, views::GridLayout::FIXED, 150 20.0f, views::GridLayout::FIXED,
152 kIconPreviewSizePixels, kIconPreviewSizePixels); 151 kIconPreviewSizePixels, kIconPreviewSizePixels);
153 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 152 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
154 80.0f, views::GridLayout::USE_PREF, 0, 0); 153 80.0f, views::GridLayout::USE_PREF, 0, 0);
155 154
156 layout->StartRow(0, kColumnSetId); 155 layout->StartRow(0, kColumnSetId);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar)); 273 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar));
275 } 274 }
276 #elif defined(OS_POSIX) 275 #elif defined(OS_POSIX)
277 menu_check_box_ = AddCheckbox( 276 menu_check_box_ = AddCheckbox(
278 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_MENU_CHKBOX), 277 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_MENU_CHKBOX),
279 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); 278 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu));
280 #endif 279 #endif
281 280
282 // Layout controls 281 // Layout controls
283 views::GridLayout* layout = views::GridLayout::CreatePanel(this); 282 views::GridLayout* layout = views::GridLayout::CreatePanel(this);
284 SetLayoutManager(layout);
285 283
286 static const int kHeaderColumnSetId = 0; 284 static const int kHeaderColumnSetId = 0;
287 views::ColumnSet* column_set = layout->AddColumnSet(kHeaderColumnSetId); 285 views::ColumnSet* column_set = layout->AddColumnSet(kHeaderColumnSetId);
288 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 286 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
289 100.0f, views::GridLayout::FIXED, 0, 0); 287 100.0f, views::GridLayout::FIXED, 0, 0);
290 288
291 static const int kTableColumnSetId = 1; 289 static const int kTableColumnSetId = 1;
292 column_set = layout->AddColumnSet(kTableColumnSetId); 290 column_set = layout->AddColumnSet(kTableColumnSetId);
293 column_set->AddPaddingColumn(0, views::kCheckboxIndent); 291 column_set->AddPaddingColumn(0, views::kCheckboxIndent);
294 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 292 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 bool CreateChromeApplicationShortcutView::Cancel() { 535 bool CreateChromeApplicationShortcutView::Cancel() {
538 if (!close_callback_.is_null()) 536 if (!close_callback_.is_null())
539 close_callback_.Run(false); 537 close_callback_.Run(false);
540 return CreateApplicationShortcutView::Cancel(); 538 return CreateApplicationShortcutView::Cancel();
541 } 539 }
542 540
543 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( 541 void CreateChromeApplicationShortcutView::OnAppInfoLoaded(
544 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { 542 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) {
545 shortcut_info_ = std::move(shortcut_info); 543 shortcut_info_ = std::move(shortcut_info);
546 } 544 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/confirm_bubble_views.cc ('k') | chrome/browser/ui/views/crypto_module_password_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698