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

Unified Diff: chrome/browser/web_applications/web_app_mac.h

Issue 9362001: Unit tests for publishing 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.h
diff --git a/chrome/browser/web_applications/web_app_mac.h b/chrome/browser/web_applications/web_app_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..261b9d724a4f00e48b7dc11546a6325f8aae60bd
--- /dev/null
+++ b/chrome/browser/web_applications/web_app_mac.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_
+#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_
+#pragma once
+
+#include "base/file_path.h"
+#include "chrome/browser/shell_integration.h"
+
+namespace web_app {
+
+// Creates a shortcut for a web application. The shortcut is a stub app
+// that simply loads the browser framework and runs the given app.
+class WebAppShortcutCreator {
+ public:
+ // Creates a new shortcut based on information in |shortcut_info|.
+ explicit WebAppShortcutCreator(
+ const ShellIntegration::ShortcutInfo& shortcut_info);
+ virtual ~WebAppShortcutCreator();
+
+ // Creates a shortcut.
+ bool CreateShortcut();
+
+ protected:
+ // Returns a path to the app loader.
+ FilePath GetAppLoaderPath() const;
+
+ // Returns a path to the destination where the app should be written to.
+ virtual FilePath GetDestinationPath(const FilePath& app_file_name) const;
+
+ // Updates the plist inside |app_path| with information about the app.
+ bool UpdatePlist(const FilePath& app_path) const;
+
+ // Updates the icon for the shortcut.
+ bool UpdateIcon(const FilePath& app_path) const;
+
+ private:
+ // Information about the app.
+ ShellIntegration::ShortcutInfo info_;
+};
+
+} // namespace web_app
+
+#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698