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

Side by Side Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 20037002: Fix app shim focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/mac/launch_services_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "chrome/browser/web_applications/web_app_mac.h" 5 #import "chrome/browser/web_applications/web_app_mac.h"
6 6
7 #import <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 base::FilePath app_data_path = web_app::GetWebAppDataDirectory( 178 base::FilePath app_data_path = web_app::GetWebAppDataDirectory(
179 shortcut_info.profile_path, shortcut_info.extension_id, GURL()); 179 shortcut_info.profile_path, shortcut_info.extension_id, GURL());
180 shim_path = app_data_path.Append(shim_path.BaseName()); 180 shim_path = app_data_path.Append(shim_path.BaseName());
181 } 181 }
182 182
183 if (!base::PathExists(shim_path)) 183 if (!base::PathExists(shim_path))
184 return; 184 return;
185 185
186 CommandLine command_line(CommandLine::NO_PROGRAM); 186 CommandLine command_line(CommandLine::NO_PROGRAM);
187 command_line.AppendSwitch(app_mode::kNoLaunchApp); 187 command_line.AppendSwitch(app_mode::kNoLaunchApp);
188 base::mac::OpenApplicationWithPath(shim_path, command_line, NULL); 188 // Launch without activating (kLSLaunchDontSwitch).
189 base::mac::OpenApplicationWithPath(
190 shim_path, command_line, kLSLaunchDefaults | kLSLaunchDontSwitch, NULL);
189 } 191 }
190 192
191 base::FilePath GetLocalizableAppShortcutsSubdirName() { 193 base::FilePath GetLocalizableAppShortcutsSubdirName() {
192 #if defined(GOOGLE_CHROME_BUILD) 194 #if defined(GOOGLE_CHROME_BUILD)
193 static const char kChromeAppDirName[] = "Chrome Apps.localized"; 195 static const char kChromeAppDirName[] = "Chrome Apps.localized";
194 static const char kChromeCanaryAppDirName[] = "Chrome Canary Apps.localized"; 196 static const char kChromeCanaryAppDirName[] = "Chrome Canary Apps.localized";
195 197
196 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 198 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
197 if (channel == chrome::VersionInfo::CHANNEL_CANARY) 199 if (channel == chrome::VersionInfo::CHANNEL_CANARY)
198 return base::FilePath(kChromeCanaryAppDirName); 200 return base::FilePath(kChromeCanaryAppDirName);
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 BuildShortcutInfoFromBundle(*it); 720 BuildShortcutInfoFromBundle(*it);
719 WebAppShortcutCreator shortcut_creator( 721 WebAppShortcutCreator shortcut_creator(
720 it->DirName(), shortcut_info, base::mac::BaseBundleID()); 722 it->DirName(), shortcut_info, base::mac::BaseBundleID());
721 shortcut_creator.DeleteShortcuts(); 723 shortcut_creator.DeleteShortcuts();
722 } 724 }
723 } 725 }
724 726
725 } // namespace internals 727 } // namespace internals
726 728
727 } // namespace web_app 729 } // namespace web_app
OLDNEW
« no previous file with comments | « base/mac/launch_services_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698