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

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

Issue 9416012: Mac: Generate App Mode Loader bundle + cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gyp dependencies 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
« no previous file with comments | « chrome/app/chrome_main_app_mode_mac.mm ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | 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 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_
6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/string16.h"
10 #include "chrome/browser/shell_integration.h" 11 #include "chrome/browser/shell_integration.h"
11 12
13 @class NSDictionary;
14 @class NSString;
15
12 namespace web_app { 16 namespace web_app {
13 17
14 // Creates a shortcut for a web application. The shortcut is a stub app 18 // Creates a shortcut for a web application. The shortcut is a stub app
15 // that simply loads the browser framework and runs the given app. 19 // that simply loads the browser framework and runs the given app.
16 class WebAppShortcutCreator { 20 class WebAppShortcutCreator {
17 public: 21 public:
18 // Creates a new shortcut based on information in |shortcut_info|. 22 // Creates a new shortcut based on information in |shortcut_info|.
23 // |chrome_bundle_id| is the CFBundleIdentifier of the Chrome browser bundle.
19 explicit WebAppShortcutCreator( 24 explicit WebAppShortcutCreator(
sail 2012/02/20 21:17:49 This doesn't need to be explicit anymore.
20 const ShellIntegration::ShortcutInfo& shortcut_info); 25 const ShellIntegration::ShortcutInfo& shortcut_info,
26 const string16& chrome_bundle_id);
21 virtual ~WebAppShortcutCreator(); 27 virtual ~WebAppShortcutCreator();
22 28
23 // Creates a shortcut. 29 // Copies the app launcher template into place and fills in all relevant
30 // information.
24 bool CreateShortcut(); 31 bool CreateShortcut();
25 32
26 protected: 33 protected:
27 // Returns a path to the app loader. 34 // Returns a path to the app loader.
28 FilePath GetAppLoaderPath() const; 35 FilePath GetAppLoaderPath() const;
29 36
30 // Returns a path to the destination where the app should be written to. 37 // Returns a path to the destination where the app should be written to.
31 virtual FilePath GetDestinationPath(const FilePath& app_file_name) const; 38 virtual FilePath GetDestinationPath(const FilePath& app_file_name) const;
32 39
33 // Updates the plist inside |app_path| with information about the app. 40 // Updates the plist inside |app_path| with information about the app.
34 bool UpdatePlist(const FilePath& app_path) const; 41 bool UpdatePlist(const FilePath& app_path) const;
35 42
36 // Updates the icon for the shortcut. 43 // Updates the icon for the shortcut.
37 bool UpdateIcon(const FilePath& app_path) const; 44 bool UpdateIcon(const FilePath& app_path) const;
38 45
39 private: 46 private:
47 // Returns the bundle identifier to use for this app bundle.
48 // |plist| is a dictionary containg a copy of the template plist file to
49 // be used for creating the app bundle.
50 NSString* GetBundleIdentifier(NSDictionary* plist) const;
51
40 // Information about the app. 52 // Information about the app.
41 ShellIntegration::ShortcutInfo info_; 53 ShellIntegration::ShortcutInfo info_;
54
55 // The CFBundleIdentifier of the Chrome browser bundle.
56 string16 chrome_bundle_id_;
42 }; 57 };
43 58
44 } // namespace web_app 59 } // namespace web_app
45 60
46 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ 61 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_app_mode_mac.mm ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698