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

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 9346013: Publish app shortcuts on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 10 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
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/app_controller_mac.h" 5 #import "chrome/browser/app_controller_mac.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Record the location of the application bundle (containing the main framework) 151 // Record the location of the application bundle (containing the main framework)
152 // from which Chromium was loaded. This is used by app mode shims to find 152 // from which Chromium was loaded. This is used by app mode shims to find
153 // Chromium. 153 // Chromium.
154 void RecordLastRunAppBundlePath() { 154 void RecordLastRunAppBundlePath() {
155 // Going up three levels from |chrome::GetVersionedDirectory()| gives the 155 // Going up three levels from |chrome::GetVersionedDirectory()| gives the
156 // real, user-visible app bundle directory. (The alternatives give either the 156 // real, user-visible app bundle directory. (The alternatives give either the
157 // framework's path or the initial app's path, which may be an app mode shim 157 // framework's path or the initial app's path, which may be an app mode shim
158 // or a unit test.) 158 // or a unit test.)
159 FilePath appBundlePath = 159 FilePath appBundlePath =
160 chrome::GetVersionedDirectory().DirName().DirName().DirName(); 160 chrome::GetVersionedDirectory().DirName().DirName().DirName();
161 CFPreferencesSetAppValue(app_mode::kLastRunAppBundlePathPrefsKey, 161 CFPreferencesSetAppValue(
162 base::SysUTF8ToCFStringRef(appBundlePath.value()), 162 base::mac::NSToCFCast(app_mode::kLastRunAppBundlePathPrefsKey),
163 BaseBundleID_CFString()); 163 base::SysUTF8ToCFStringRef(appBundlePath.value()),
164 BaseBundleID_CFString());
164 165
165 // Sync after a delay avoid I/O contention on startup; 1500 ms is plenty. 166 // Sync after a delay avoid I/O contention on startup; 1500 ms is plenty.
166 BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, 167 BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE,
167 base::Bind(&PrefsSyncCallback), 1500); 168 base::Bind(&PrefsSyncCallback), 1500);
168 } 169 }
169 170
170 } // anonymous namespace 171 } // anonymous namespace
171 172
172 const AEEventClass kAECloudPrintInstallClass = 'GCPi'; 173 const AEEventClass kAECloudPrintInstallClass = 'GCPi';
173 const AEEventClass kAECloudPrintUninstallClass = 'GCPu'; 174 const AEEventClass kAECloudPrintUninstallClass = 'GCPu';
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 1336
1336 } // namespace browser 1337 } // namespace browser
1337 1338
1338 namespace app_controller_mac { 1339 namespace app_controller_mac {
1339 1340
1340 bool IsOpeningNewWindow() { 1341 bool IsOpeningNewWindow() {
1341 return g_is_opening_new_window; 1342 return g_is_opening_new_window;
1342 } 1343 }
1343 1344
1344 } // namespace app_controller_mac 1345 } // namespace app_controller_mac
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698