summaryrefslogtreecommitdiffstats
path: root/apps/app_shim/app_shim_handler_mac.h
diff options
context:
space:
mode:
authorjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 23:23:50 +0000
committerjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 23:23:50 +0000
commit25321031d80042c0b13fbb83ce706b2c45239f2a (patch)
treeecf37270632e1ee069aa2ea723b7ce9639cdbb4b /apps/app_shim/app_shim_handler_mac.h
parentab862306ca2fd7a95d139ae66a2cc1ee06f0211a (diff)
downloadchromium_src-25321031d80042c0b13fbb83ce706b2c45239f2a.zip
chromium_src-25321031d80042c0b13fbb83ce706b2c45239f2a.tar.gz
chromium_src-25321031d80042c0b13fbb83ce706b2c45239f2a.tar.bz2
Enable passing a file path to an app via its shim.
This allows opening a file with a packaged app by dropping the file the app shim's dock icon or app bundle. A base::FilePath param is added to the Launch and Focus IPC messages and respective AppShimHandler methods. The file path ultimately is added to the command line used by OpenApplication. The shim is modified to set a custom NSApplicationDelegate early in order to capture the call to application:openFile:. The file name is saved and sent via LaunchApp in AppShimController::Init. BUG=168080 TEST=Drag a file onto an app shim. The app should start and open the file. Drag a file onto the app shim's dock icon. The app should open the file. Review URL: https://chromiumcodereview.appspot.com/21005003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/app_shim/app_shim_handler_mac.h')
-rw-r--r--apps/app_shim/app_shim_handler_mac.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/app_shim/app_shim_handler_mac.h b/apps/app_shim/app_shim_handler_mac.h
index e442e64..66dbea9 100644
--- a/apps/app_shim/app_shim_handler_mac.h
+++ b/apps/app_shim/app_shim_handler_mac.h
@@ -6,6 +6,7 @@
#define APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_
#include <string>
+#include <vector>
#include "apps/app_shim/app_shim_launch.h"
#include "base/files/file_path.h"
@@ -55,14 +56,22 @@ class AppShimHandler {
// Invoked by the shim host when the shim process is launched. The handler
// must call OnAppLaunchComplete to inform the shim of the result.
- // |launch_now| indicates whether to launch the associated app.
- virtual void OnShimLaunch(Host* host, AppShimLaunchType launch_type) = 0;
+ // |launch_type| indicates the type of launch.
+ // |files|, if non-empty, holds an array of files paths given as arguments, or
+ // dragged onto the app bundle or dock icon.
+ virtual void OnShimLaunch(Host* host,
+ AppShimLaunchType launch_type,
+ const std::vector<base::FilePath>& files) = 0;
// Invoked by the shim host when the connection to the shim process is closed.
virtual void OnShimClose(Host* host) = 0;
// Invoked by the shim host when the shim process receives a focus event.
- virtual void OnShimFocus(Host* host, AppShimFocusType focus_type) = 0;
+ // |files|, if non-empty, holds an array of files dragged onto the app bundle
+ // or dock icon.
+ virtual void OnShimFocus(Host* host,
+ AppShimFocusType focus_type,
+ const std::vector<base::FilePath>& files) = 0;
// Invoked by the shim host when the shim process is hidden or shown.
virtual void OnShimSetHidden(Host* host, bool hidden) = 0;