Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Unified Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 18421007: [win] Set the profile path when enabling the app launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, and fix a few things Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698