| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if (description_) { | 112 if (description_) { |
| 113 description_->SetText(text); | 113 description_->SetText(text); |
| 114 } else { | 114 } else { |
| 115 description_ = new views::Label(text); | 115 description_ = new views::Label(text); |
| 116 description_->SetMultiLine(true); | 116 description_->SetMultiLine(true); |
| 117 description_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 117 description_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 void AppInfoView::SetupLayout() { | 121 void AppInfoView::SetupLayout() { |
| 122 views::GridLayout* layout = CreatePanelGridLayout(this); | 122 views::GridLayout* layout = views::GridLayout::CreatePanel(this); |
| 123 SetLayoutManager(layout); | 123 SetLayoutManager(layout); |
| 124 | 124 |
| 125 static const int kColumnSetId = 0; | 125 static const int kColumnSetId = 0; |
| 126 views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); | 126 views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); |
| 127 column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::LEADING, | 127 column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::LEADING, |
| 128 20.0f, views::GridLayout::FIXED, | 128 20.0f, views::GridLayout::FIXED, |
| 129 kAppIconSize, kAppIconSize); | 129 kAppIconSize, kAppIconSize); |
| 130 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, | 130 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, |
| 131 80.0f, views::GridLayout::USE_PREF, 0, 0); | 131 80.0f, views::GridLayout::USE_PREF, 0, 0); |
| 132 | 132 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 UTF16ToWide(l10n_util::GetStringUTF16( | 256 UTF16ToWide(l10n_util::GetStringUTF16( |
| 257 IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX)), | 257 IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX)), |
| 258 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar)); | 258 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar)); |
| 259 #elif defined(OS_LINUX) | 259 #elif defined(OS_LINUX) |
| 260 menu_check_box_ = AddCheckbox( | 260 menu_check_box_ = AddCheckbox( |
| 261 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_MENU_CHKBOX)), | 261 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_MENU_CHKBOX)), |
| 262 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); | 262 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); |
| 263 #endif | 263 #endif |
| 264 | 264 |
| 265 // Layout controls | 265 // Layout controls |
| 266 views::GridLayout* layout = CreatePanelGridLayout(this); | 266 views::GridLayout* layout = views::GridLayout::CreatePanel(this); |
| 267 SetLayoutManager(layout); | 267 SetLayoutManager(layout); |
| 268 | 268 |
| 269 static const int kHeaderColumnSetId = 0; | 269 static const int kHeaderColumnSetId = 0; |
| 270 views::ColumnSet* column_set = layout->AddColumnSet(kHeaderColumnSetId); | 270 views::ColumnSet* column_set = layout->AddColumnSet(kHeaderColumnSetId); |
| 271 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, | 271 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, |
| 272 100.0f, views::GridLayout::FIXED, 0, 0); | 272 100.0f, views::GridLayout::FIXED, 0, 0); |
| 273 | 273 |
| 274 static const int kTableColumnSetId = 1; | 274 static const int kTableColumnSetId = 1; |
| 275 column_set = layout->AddColumnSet(kTableColumnSetId); | 275 column_set = layout->AddColumnSet(kTableColumnSetId); |
| 276 column_set->AddPaddingColumn(5.0f, 10); | 276 column_set->AddPaddingColumn(5.0f, 10); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 void CreateChromeApplicationShortcutView::OnImageLoaded( | 513 void CreateChromeApplicationShortcutView::OnImageLoaded( |
| 514 SkBitmap* image, ExtensionResource resource, int index) { | 514 SkBitmap* image, ExtensionResource resource, int index) { |
| 515 if (image->isNull()) { | 515 if (image->isNull()) { |
| 516 NOTREACHED() << "Corrupt image in profile?"; | 516 NOTREACHED() << "Corrupt image in profile?"; |
| 517 return; | 517 return; |
| 518 } | 518 } |
| 519 shortcut_info_.favicon = *image; | 519 shortcut_info_.favicon = *image; |
| 520 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 520 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 521 } | 521 } |
| 522 | 522 |
| OLD | NEW |