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

Side by Side Diff: chrome/app/app_mode_loader_mac.mm

Issue 9426030: Mac: Enable WebAppShortcutCreatorTest.CreateShortcut unit test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fixes 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 // On Mac, shortcuts can't have command-line arguments. Instead, produce small 5 // On Mac, shortcuts can't have command-line arguments. Instead, produce small
6 // app bundles which locate the Chromium framework and load it, passing the 6 // app bundles which locate the Chromium framework and load it, passing the
7 // appropriate data. This is the code for such an app bundle. It should be kept 7 // appropriate data. This is the code for such an app bundle. It should be kept
8 // minimal and do as little work as possible (with as much work done on 8 // minimal and do as little work as possible (with as much work done on
9 // framework side as possible). 9 // framework side as possible).
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // Read information about the this app shortcut from the Info.plist. 80 // Read information about the this app shortcut from the Info.plist.
81 // Don't check for null-ness on optional items. 81 // Don't check for null-ness on optional items.
82 NSDictionary* info_plist = [app_bundle infoDictionary]; 82 NSDictionary* info_plist = [app_bundle infoDictionary];
83 CHECK(info_plist) << "couldn't get loader Info.plist"; 83 CHECK(info_plist) << "couldn't get loader Info.plist";
84 84
85 info->app_mode_id = SysNSStringToUTF8( 85 info->app_mode_id = SysNSStringToUTF8(
86 [info_plist objectForKey:app_mode::kCrAppModeShortcutIDKey]); 86 [info_plist objectForKey:app_mode::kCrAppModeShortcutIDKey]);
87 CHECK(info->app_mode_id.size()) << "couldn't get app shortcut ID"; 87 CHECK(info->app_mode_id.size()) << "couldn't get app shortcut ID";
88 88
89 info->app_mode_short_name = SysNSStringToUTF16(
90 [info_plist objectForKey:app_mode::kCrAppModeShortcutShortNameKey]);
91
92 info->app_mode_name = SysNSStringToUTF16( 89 info->app_mode_name = SysNSStringToUTF16(
93 [info_plist objectForKey:app_mode::kCrAppModeShortcutNameKey]); 90 [info_plist objectForKey:app_mode::kCrAppModeShortcutNameKey]);
94 91
95 info->app_mode_url = SysNSStringToUTF8( 92 info->app_mode_url = SysNSStringToUTF8(
96 [info_plist objectForKey:app_mode::kCrAppModeShortcutURLKey]); 93 [info_plist objectForKey:app_mode::kCrAppModeShortcutURLKey]);
97 94
98 // Open the framework. 95 // Open the framework.
99 *cr_dylib = dlopen(framework_shlib_path.value().c_str(), RTLD_LAZY); 96 *cr_dylib = dlopen(framework_shlib_path.value().c_str(), RTLD_LAZY);
100 CHECK(cr_dylib) << "couldn't load framework: " << dlerror(); 97 CHECK(cr_dylib) << "couldn't load framework: " << dlerror();
101 } 98 }
(...skipping 16 matching lines...) Expand all
118 115
119 typedef int (*StartFun)(const app_mode::ChromeAppModeInfo*); 116 typedef int (*StartFun)(const app_mode::ChromeAppModeInfo*);
120 StartFun ChromeAppModeStart = (StartFun)dlsym(cr_dylib, "ChromeAppModeStart"); 117 StartFun ChromeAppModeStart = (StartFun)dlsym(cr_dylib, "ChromeAppModeStart");
121 CHECK(ChromeAppModeStart) << "couldn't get entry point"; 118 CHECK(ChromeAppModeStart) << "couldn't get entry point";
122 119
123 // Exit instead of returning to avoid the the removal of |main()| from stack 120 // Exit instead of returning to avoid the the removal of |main()| from stack
124 // backtraces under tail call optimization. 121 // backtraces under tail call optimization.
125 int rv = ChromeAppModeStart(&info); 122 int rv = ChromeAppModeStart(&info);
126 exit(rv); 123 exit(rv);
127 } 124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698