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

Side by Side Diff: apps/app_shim/extension_app_shim_handler_mac.h

Issue 113553002: Use ExtensionEnableFlow for shim initiated launches. (Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't pass pointers in callback. Handle deleted app or profile. Created 7 years 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 | « apps/app_shim/DEPS ('k') | apps/app_shim/extension_app_shim_handler_mac.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_H_ 5 #ifndef APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_H_
6 #define APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_H_ 6 #define APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 virtual bool ProfileExistsForPath(const base::FilePath& path); 48 virtual bool ProfileExistsForPath(const base::FilePath& path);
49 virtual Profile* ProfileForPath(const base::FilePath& path); 49 virtual Profile* ProfileForPath(const base::FilePath& path);
50 virtual void LoadProfileAsync(const base::FilePath& path, 50 virtual void LoadProfileAsync(const base::FilePath& path,
51 base::Callback<void(Profile*)> callback); 51 base::Callback<void(Profile*)> callback);
52 52
53 virtual ShellWindowRegistry::ShellWindowList GetWindows( 53 virtual ShellWindowRegistry::ShellWindowList GetWindows(
54 Profile* profile, const std::string& extension_id); 54 Profile* profile, const std::string& extension_id);
55 55
56 virtual const extensions::Extension* GetAppExtension( 56 virtual const extensions::Extension* GetAppExtension(
57 Profile* profile, const std::string& extension_id); 57 Profile* profile, const std::string& extension_id);
58 virtual void EnableExtension(Profile* profile,
59 const std::string& extension_id,
60 const base::Callback<void()>& callback);
58 virtual void LaunchApp(Profile* profile, 61 virtual void LaunchApp(Profile* profile,
59 const extensions::Extension* extension, 62 const extensions::Extension* extension,
60 const std::vector<base::FilePath>& files); 63 const std::vector<base::FilePath>& files);
61 virtual void LaunchShim(Profile* profile, 64 virtual void LaunchShim(Profile* profile,
62 const extensions::Extension* extension); 65 const extensions::Extension* extension);
63 66
64 virtual void MaybeTerminate(); 67 virtual void MaybeTerminate();
65 }; 68 };
66 69
67 ExtensionAppShimHandler(); 70 ExtensionAppShimHandler();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 content::NotificationRegistrar& registrar() { return registrar_; } 117 content::NotificationRegistrar& registrar() { return registrar_; }
115 118
116 private: 119 private:
117 // This is passed to Delegate::LoadProfileAsync for shim-initiated launches 120 // This is passed to Delegate::LoadProfileAsync for shim-initiated launches
118 // where the profile was not yet loaded. 121 // where the profile was not yet loaded.
119 void OnProfileLoaded(Host* host, 122 void OnProfileLoaded(Host* host,
120 AppShimLaunchType launch_type, 123 AppShimLaunchType launch_type,
121 const std::vector<base::FilePath>& files, 124 const std::vector<base::FilePath>& files,
122 Profile* profile); 125 Profile* profile);
123 126
127 // This is passed to Delegate::EnableViaPrompt for shim-initiated launches
128 // where the extension is disabled.
129 void OnExtensionEnabled(const base::FilePath& profile_path,
130 const std::string& app_id,
131 const std::vector<base::FilePath>& files);
132
124 scoped_ptr<Delegate> delegate_; 133 scoped_ptr<Delegate> delegate_;
125 134
126 HostMap hosts_; 135 HostMap hosts_;
127 136
128 content::NotificationRegistrar registrar_; 137 content::NotificationRegistrar registrar_;
129 138
130 base::WeakPtrFactory<ExtensionAppShimHandler> weak_factory_; 139 base::WeakPtrFactory<ExtensionAppShimHandler> weak_factory_;
131 140
132 DISALLOW_COPY_AND_ASSIGN(ExtensionAppShimHandler); 141 DISALLOW_COPY_AND_ASSIGN(ExtensionAppShimHandler);
133 }; 142 };
134 143
135 } // namespace apps 144 } // namespace apps
136 145
137 #endif // APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_H_ 146 #endif // APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_H_
OLDNEW
« no previous file with comments | « apps/app_shim/DEPS ('k') | apps/app_shim/extension_app_shim_handler_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698