| 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 <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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 369 |
| 370 #if defined(OS_WIN) | 370 #if defined(OS_WIN) |
| 371 shortcut_info_.create_in_quick_launch_bar = quick_launch_check_box_ == NULL ? | 371 shortcut_info_.create_in_quick_launch_bar = quick_launch_check_box_ == NULL ? |
| 372 NULL : quick_launch_check_box_->checked(); | 372 NULL : quick_launch_check_box_->checked(); |
| 373 #elif defined(OS_POSIX) | 373 #elif defined(OS_POSIX) |
| 374 // Create shortcut in Mac dock or as Linux (gnome/kde) application launcher | 374 // Create shortcut in Mac dock or as Linux (gnome/kde) application launcher |
| 375 // are not implemented yet. | 375 // are not implemented yet. |
| 376 shortcut_info_.create_in_quick_launch_bar = false; | 376 shortcut_info_.create_in_quick_launch_bar = false; |
| 377 #endif | 377 #endif |
| 378 | 378 |
| 379 web_app::CreateShortcut(profile_->GetPath(), | 379 web_app::CreateShortcut(profile_->GetPath(), shortcut_info_); |
| 380 shortcut_info_, | |
| 381 NULL); | |
| 382 return true; | 380 return true; |
| 383 } | 381 } |
| 384 | 382 |
| 385 | 383 |
| 386 views::View* CreateApplicationShortcutView::GetContentsView() { | 384 views::View* CreateApplicationShortcutView::GetContentsView() { |
| 387 return this; | 385 return this; |
| 388 } | 386 } |
| 389 | 387 |
| 390 views::Checkbox* CreateApplicationShortcutView::AddCheckbox( | 388 views::Checkbox* CreateApplicationShortcutView::AddCheckbox( |
| 391 const string16& text, bool checked) { | 389 const string16& text, bool checked) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // Called by tracker_ when the app's icon is loaded. | 523 // Called by tracker_ when the app's icon is loaded. |
| 526 void CreateChromeApplicationShortcutView::OnImageLoaded( | 524 void CreateChromeApplicationShortcutView::OnImageLoaded( |
| 527 SkBitmap* image, const ExtensionResource& resource, int index) { | 525 SkBitmap* image, const ExtensionResource& resource, int index) { |
| 528 if (!image || image->isNull()) | 526 if (!image || image->isNull()) |
| 529 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); | 527 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); |
| 530 | 528 |
| 531 shortcut_info_.favicon = *image; | 529 shortcut_info_.favicon = *image; |
| 532 CHECK(app_info_); | 530 CHECK(app_info_); |
| 533 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 531 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 534 } | 532 } |
| OLD | NEW |