| Index: chrome/browser/ui/app_list/app_list_service_mac.mm
|
| diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm
|
| index 42e5432bdf16301042bd8b6bd1c18cff80a3d952..15f4ff5bb639c6777a84935dbfae3acbc12babaf 100644
|
| --- a/chrome/browser/ui/app_list/app_list_service_mac.mm
|
| +++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
|
| @@ -63,9 +63,11 @@ class AppListServiceMac : public AppListServiceImpl,
|
| virtual void ShowAppList(Profile* requested_profile) OVERRIDE;
|
| virtual void DismissAppList() OVERRIDE;
|
| virtual bool IsAppListVisible() const OVERRIDE;
|
| - virtual void EnableAppList() OVERRIDE;
|
| virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
|
|
|
| + // AppListServiceImpl override:
|
| + virtual void CreateShortcut() OVERRIDE;
|
| +
|
| // AppShimHandler overrides:
|
| virtual void OnShimLaunch(apps::AppShimHandler::Host* host,
|
| apps::AppShimLaunchType launch_type) OVERRIDE;
|
| @@ -170,29 +172,6 @@ void CreateAppListShim(const base::FilePath& profile_path) {
|
| web_app::ALLOW_DUPLICATE_SHORTCUTS);
|
| }
|
|
|
| -// Check that there is an app list shim. If enabling and there is not, make one.
|
| -// If disabling with --enable-app-list-shim=0, and there is one, delete it.
|
| -void CheckAppListShimOnFileThread(const base::FilePath& profile_path) {
|
| - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
|
| - const bool enable =
|
| - CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppListShim);
|
| - base::FilePath install_path = web_app::GetAppInstallPath(
|
| - GetAppListShortcutInfo(profile_path));
|
| - if (enable == file_util::PathExists(install_path))
|
| - return;
|
| -
|
| - if (enable) {
|
| - content::BrowserThread::PostTask(
|
| - content::BrowserThread::UI, FROM_HERE,
|
| - base::Bind(&CreateAppListShim, profile_path));
|
| - return;
|
| - }
|
| -
|
| - // Sanity check because deleting things recursively is scary.
|
| - CHECK(install_path.MatchesExtension(".app"));
|
| - base::Delete(install_path, true /* recursive */);
|
| -}
|
| -
|
| void CreateShortcutsInDefaultLocation(
|
| const ShellIntegration::ShortcutInfo& shortcut_info) {
|
| web_app::CreateShortcuts(shortcut_info,
|
| @@ -267,15 +246,10 @@ void AppListServiceMac::Init(Profile* initial_profile) {
|
| // browser window open and a new window is opened, and during process startup
|
| // to handle the silent launch case (e.g. for app shims). In the startup case,
|
| // a profile has not yet been determined so |initial_profile| will be NULL.
|
| - if (initial_profile) {
|
| - static bool checked_shim = false;
|
| - if (!checked_shim) {
|
| - checked_shim = true;
|
| - content::BrowserThread::PostTask(
|
| - content::BrowserThread::FILE, FROM_HERE,
|
| - base::Bind(&CheckAppListShimOnFileThread,
|
| - initial_profile->GetPath()));
|
| - }
|
| + static bool init_called_with_profile = false;
|
| + if (initial_profile && !init_called_with_profile) {
|
| + init_called_with_profile = true;
|
| + SharedDesktopInit(initial_profile);
|
| }
|
|
|
| static bool init_called = false;
|
| @@ -295,7 +269,7 @@ void AppListServiceMac::ShowAppList(Profile* requested_profile) {
|
| return;
|
| }
|
|
|
| - SaveProfilePathToLocalState(requested_profile->GetPath());
|
| + SetProfilePath(requested_profile->GetPath());
|
|
|
| DismissAppList();
|
| CreateAppList(requested_profile);
|
| @@ -317,8 +291,8 @@ bool AppListServiceMac::IsAppListVisible() const {
|
| return [[window_controller_ window] isVisible];
|
| }
|
|
|
| -void AppListServiceMac::EnableAppList() {
|
| - // TODO(tapted): Implement enable logic here for OSX.
|
| +void AppListServiceMac::CreateShortcut() {
|
| + CreateAppListShim(GetProfilePath(base::FilePath()));
|
| }
|
|
|
| NSWindow* AppListServiceMac::GetAppListWindow() {
|
|
|