| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/codec/png_codec.h" | 8 #include "app/gfx/codec/png_codec.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 } | 305 } |
| 306 | 306 |
| 307 if (quick_launch_check_box_ != NULL) { | 307 if (quick_launch_check_box_ != NULL) { |
| 308 layout->AddPaddingRow(0, kRelatedControlSmallVerticalSpacing); | 308 layout->AddPaddingRow(0, kRelatedControlSmallVerticalSpacing); |
| 309 layout->StartRow(0, kTableColumnSetId); | 309 layout->StartRow(0, kTableColumnSetId); |
| 310 layout->AddView(quick_launch_check_box_); | 310 layout->AddView(quick_launch_check_box_); |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 | 313 |
| 314 gfx::Size CreateApplicationShortcutView::GetPreferredSize() { | 314 gfx::Size CreateApplicationShortcutView::GetPreferredSize() { |
| 315 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS? |
| 315 static const int kDialogWidth = 360; | 316 static const int kDialogWidth = 360; |
| 316 int height = GetLayoutManager()->GetPreferredHeightForWidth(this, | 317 int height = GetLayoutManager()->GetPreferredHeightForWidth(this, |
| 317 kDialogWidth); | 318 kDialogWidth); |
| 318 return gfx::Size(kDialogWidth, height); | 319 return gfx::Size(kDialogWidth, height); |
| 319 } | 320 } |
| 320 | 321 |
| 321 std::wstring CreateApplicationShortcutView::GetDialogButtonLabel( | 322 std::wstring CreateApplicationShortcutView::GetDialogButtonLabel( |
| 322 MessageBoxFlags::DialogButton button) const { | 323 MessageBoxFlags::DialogButton button) const { |
| 323 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { | 324 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { |
| 324 return l10n_util::GetString(IDS_CREATE_SHORTCUTS_COMMIT); | 325 return l10n_util::GetString(IDS_CREATE_SHORTCUTS_COMMIT); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 const SkBitmap& image) { | 445 const SkBitmap& image) { |
| 445 pending_download_ = NULL; | 446 pending_download_ = NULL; |
| 446 | 447 |
| 447 if (!errored && !image.isNull()) { | 448 if (!errored && !image.isNull()) { |
| 448 shortcut_info_.favicon = image; | 449 shortcut_info_.favicon = image; |
| 449 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 450 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 450 } else { | 451 } else { |
| 451 FetchIcon(); | 452 FetchIcon(); |
| 452 } | 453 } |
| 453 } | 454 } |
| OLD | NEW |