| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 layout->AddView(menu_check_box_); | 325 layout->AddView(menu_check_box_); |
| 326 } | 326 } |
| 327 | 327 |
| 328 if (quick_launch_check_box_ != NULL) { | 328 if (quick_launch_check_box_ != NULL) { |
| 329 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); | 329 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); |
| 330 layout->StartRow(0, kTableColumnSetId); | 330 layout->StartRow(0, kTableColumnSetId); |
| 331 layout->AddView(quick_launch_check_box_); | 331 layout->AddView(quick_launch_check_box_); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 gfx::Size CreateApplicationShortcutView::GetPreferredSize() { | 335 gfx::Size CreateApplicationShortcutView::GetPreferredSize() const { |
| 336 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS? | 336 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS? |
| 337 static const int kDialogWidth = 360; | 337 static const int kDialogWidth = 360; |
| 338 int height = GetLayoutManager()->GetPreferredHeightForWidth(this, | 338 int height = GetLayoutManager()->GetPreferredHeightForWidth(this, |
| 339 kDialogWidth); | 339 kDialogWidth); |
| 340 return gfx::Size(kDialogWidth, height); | 340 return gfx::Size(kDialogWidth, height); |
| 341 } | 341 } |
| 342 | 342 |
| 343 base::string16 CreateApplicationShortcutView::GetDialogButtonLabel( | 343 base::string16 CreateApplicationShortcutView::GetDialogButtonLabel( |
| 344 ui::DialogButton button) const { | 344 ui::DialogButton button) const { |
| 345 if (button == ui::DIALOG_BUTTON_OK) | 345 if (button == ui::DIALOG_BUTTON_OK) |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 | 555 |
| 556 // Called when the app's ShortcutInfo (with icon) is loaded. | 556 // Called when the app's ShortcutInfo (with icon) is loaded. |
| 557 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( | 557 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( |
| 558 const web_app::ShortcutInfo& shortcut_info) { | 558 const web_app::ShortcutInfo& shortcut_info) { |
| 559 shortcut_info_ = shortcut_info; | 559 shortcut_info_ = shortcut_info; |
| 560 | 560 |
| 561 CHECK(app_info_); | 561 CHECK(app_info_); |
| 562 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 562 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 563 } | 563 } |
| OLD | NEW |