| 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/extensions/app_shortcut_manager.h" | 5 #include "chrome/browser/extensions/app_shortcut_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 9 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 #endif | 66 #endif |
| 67 | 67 |
| 68 const int kAppIconSize = 32; | 68 const int kAppIconSize = 32; |
| 69 | 69 |
| 70 shortcut_info_.extension_id = extension->id(); | 70 shortcut_info_.extension_id = extension->id(); |
| 71 shortcut_info_.url = GURL(extension->launch_web_url()); | 71 shortcut_info_.url = GURL(extension->launch_web_url()); |
| 72 shortcut_info_.title = UTF8ToUTF16(extension->name()); | 72 shortcut_info_.title = UTF8ToUTF16(extension->name()); |
| 73 shortcut_info_.description = UTF8ToUTF16(extension->description()); | 73 shortcut_info_.description = UTF8ToUTF16(extension->description()); |
| 74 shortcut_info_.extension_path = extension->path(); |
| 74 shortcut_info_.create_in_applications_menu = true; | 75 shortcut_info_.create_in_applications_menu = true; |
| 75 shortcut_info_.create_in_quick_launch_bar = true; | 76 shortcut_info_.create_in_quick_launch_bar = true; |
| 76 shortcut_info_.create_on_desktop = true; | 77 shortcut_info_.create_on_desktop = true; |
| 77 | 78 |
| 78 // The icon will be resized to |max_size|. | 79 // The icon will be resized to |max_size|. |
| 79 const gfx::Size max_size(kAppIconSize, kAppIconSize); | 80 const gfx::Size max_size(kAppIconSize, kAppIconSize); |
| 80 | 81 |
| 81 // Look for an icon. If there is no icon at the ideal size, we will resize | 82 // Look for an icon. If there is no icon at the ideal size, we will resize |
| 82 // whatever we can get. Making a large icon smaller is prefered to making a | 83 // whatever we can get. Making a large icon smaller is prefered to making a |
| 83 // small icon larger, so look for a larger icon first: | 84 // small icon larger, so look for a larger icon first: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 94 } | 95 } |
| 95 | 96 |
| 96 // icon_resource may still be empty at this point, in which case LoadImage | 97 // icon_resource may still be empty at this point, in which case LoadImage |
| 97 // which call the OnImageLoaded callback with a NULL image and exit | 98 // which call the OnImageLoaded callback with a NULL image and exit |
| 98 // immediately. | 99 // immediately. |
| 99 tracker_.LoadImage(extension, | 100 tracker_.LoadImage(extension, |
| 100 icon_resource, | 101 icon_resource, |
| 101 max_size, | 102 max_size, |
| 102 ImageLoadingTracker::DONT_CACHE); | 103 ImageLoadingTracker::DONT_CACHE); |
| 103 } | 104 } |
| OLD | NEW |