| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "chrome/browser/ui/app_list/app_list_service_mac.h" | 5 #import "chrome/browser/ui/app_list/app_list_service_mac.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Duration of show and hide animations. | 83 // Duration of show and hide animations. |
| 84 const NSTimeInterval kAnimationDuration = 0.2; | 84 const NSTimeInterval kAnimationDuration = 0.2; |
| 85 | 85 |
| 86 // Distance towards the screen edge that the app list moves from when showing. | 86 // Distance towards the screen edge that the app list moves from when showing. |
| 87 const CGFloat kDistanceMovedOnShow = 20; | 87 const CGFloat kDistanceMovedOnShow = 20; |
| 88 | 88 |
| 89 scoped_ptr<web_app::ShortcutInfo> GetAppListShortcutInfo( | 89 scoped_ptr<web_app::ShortcutInfo> GetAppListShortcutInfo( |
| 90 const base::FilePath& profile_path) { | 90 const base::FilePath& profile_path) { |
| 91 scoped_ptr<web_app::ShortcutInfo> shortcut_info(new web_app::ShortcutInfo); | 91 scoped_ptr<web_app::ShortcutInfo> shortcut_info(new web_app::ShortcutInfo); |
| 92 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 92 version_info::Channel channel = chrome::VersionInfo::GetChannel(); |
| 93 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { | 93 if (channel == version_info::Channel::CANARY) { |
| 94 shortcut_info->title = | 94 shortcut_info->title = |
| 95 l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME_CANARY); | 95 l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME_CANARY); |
| 96 } else { | 96 } else { |
| 97 shortcut_info->title = | 97 shortcut_info->title = |
| 98 l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME); | 98 l10n_util::GetStringUTF16(IDS_APP_LIST_SHORTCUT_NAME); |
| 99 } | 99 } |
| 100 | 100 |
| 101 shortcut_info->extension_id = app_mode::kAppListModeId; | 101 shortcut_info->extension_id = app_mode::kAppListModeId; |
| 102 shortcut_info->description = shortcut_info->title; | 102 shortcut_info->description = shortcut_info->title; |
| 103 shortcut_info->profile_path = profile_path; | 103 shortcut_info->profile_path = profile_path; |
| 104 | 104 |
| 105 return shortcut_info; | 105 return shortcut_info; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void CreateAppListShim(const base::FilePath& profile_path) { | 108 void CreateAppListShim(const base::FilePath& profile_path) { |
| 109 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 109 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 110 WebApplicationInfo web_app_info; | 110 WebApplicationInfo web_app_info; |
| 111 scoped_ptr<web_app::ShortcutInfo> shortcut_info = | 111 scoped_ptr<web_app::ShortcutInfo> shortcut_info = |
| 112 GetAppListShortcutInfo(profile_path); | 112 GetAppListShortcutInfo(profile_path); |
| 113 | 113 |
| 114 ResourceBundle& resource_bundle = ResourceBundle::GetSharedInstance(); | 114 ResourceBundle& resource_bundle = ResourceBundle::GetSharedInstance(); |
| 115 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 115 version_info::Channel channel = chrome::VersionInfo::GetChannel(); |
| 116 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { | 116 if (channel == version_info::Channel::CANARY) { |
| 117 #if defined(GOOGLE_CHROME_BUILD) | 117 #if defined(GOOGLE_CHROME_BUILD) |
| 118 shortcut_info->favicon.Add( | 118 shortcut_info->favicon.Add( |
| 119 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_16)); | 119 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_16)); |
| 120 shortcut_info->favicon.Add( | 120 shortcut_info->favicon.Add( |
| 121 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_32)); | 121 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_32)); |
| 122 shortcut_info->favicon.Add( | 122 shortcut_info->favicon.Add( |
| 123 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_128)); | 123 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_128)); |
| 124 shortcut_info->favicon.Add( | 124 shortcut_info->favicon.Add( |
| 125 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_256)); | 125 *resource_bundle.GetImageSkiaNamed(IDR_APP_LIST_CANARY_256)); |
| 126 #else | 126 #else |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 - (void)animationDidEnd:(NSAnimation*)animation { | 584 - (void)animationDidEnd:(NSAnimation*)animation { |
| 585 content::BrowserThread::PostTask( | 585 content::BrowserThread::PostTask( |
| 586 content::BrowserThread::UI, | 586 content::BrowserThread::UI, |
| 587 FROM_HERE, | 587 FROM_HERE, |
| 588 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, | 588 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, |
| 589 base::Unretained(GetActiveInstance()))); | 589 base::Unretained(GetActiveInstance()))); |
| 590 } | 590 } |
| 591 | 591 |
| 592 @end | 592 @end |
| OLD | NEW |