OLD | NEW |
---|---|
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_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
7 | 7 |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 namespace app_file_handler_util { | 21 namespace app_file_handler_util { |
22 struct GrantedFileEntry; | 22 struct GrantedFileEntry; |
23 } | 23 } |
24 | 24 |
25 class AppEventRouter { | 25 class AppEventRouter { |
26 public: | 26 public: |
27 // Dispatches the onLaunched event to the given app, providing no launch | 27 // Dispatches the onLaunched event to the given app, providing no launch |
28 // data. | 28 // data. |
29 static void DispatchOnLaunchedEvent(Profile* profile, | 29 static void DispatchOnLaunchedEvent(Profile* profile, |
30 const Extension* extension); | 30 const Extension* extension); |
31 | |
32 // Dispatches the onRestarted event to the given app, providing a list of | |
33 // restored file entries from the previous run. | |
31 static void DispatchOnRestartedEvent( | 34 static void DispatchOnRestartedEvent( |
32 Profile* profile, | 35 Profile* profile, |
33 const Extension* extension, | 36 const Extension* extension, |
34 const std::vector<app_file_handler_util::GrantedFileEntry>& file_entries); | 37 const std::vector<app_file_handler_util::GrantedFileEntry>& file_entries); |
35 | 38 |
36 // TODO(benwells): Update this comment, it is out of date. | 39 // TODO(benwells): Update this comment, it is out of date. |
37 // Dispatches the onLaunched event to the given app, providing launch data of | 40 // Dispatches the onLaunched event to the given app, providing launch data of |
38 // the form: | 41 // the form: |
39 // { | 42 // { |
40 // "intent" : { | 43 // "intent" : { |
41 // "type" : "chrome-extension://fileentry", | 44 // "type" : "chrome-extension://fileentry", |
42 // "data" : a FileEntry, | 45 // "data" : a FileEntry, |
43 // "postResults" : a null function, | 46 // "postResults" : a null function, |
44 // "postFailure" : a null function | 47 // "postFailure" : a null function |
45 // } | 48 // } |
46 // } | 49 // } |
47 | 50 |
48 // launchData.intent.data and launchData.intent.postResults are created in a | 51 // launchData.intent.data and launchData.intent.postResults are created in a |
49 // custom dispatch event in javascript. The FileEntry is created from | 52 // custom dispatch event in javascript. The FileEntry is created from |
50 // |file_system_id| and |base_name|. | 53 // |file_system_id| and |base_name|. |
51 static void DispatchOnLaunchedEventWithFileEntry( | 54 static void DispatchOnLaunchedEventWithFileEntry( |
52 Profile* profile, | 55 Profile* profile, |
53 const Extension* extension, | 56 const Extension* extension, |
54 const std::string& handler_id, | 57 const std::string& handler_id, |
55 const std::string& mime_type, | 58 const std::string& mime_type, |
56 const std::string& file_system_id, | 59 const std::string& file_system_id, |
57 const std::string& base_name); | 60 const std::string& base_name); |
61 | |
62 // Redirects a URL |url| to |extension|. | |
63 // launchData.intent.data and launchData.intent.postResults are created in a | |
64 // custom dispatch event in javascript. | |
asargent_no_longer_on_chrome
2013/08/14 18:05:12
This comment seems unrelated to the implementation
sergeygs
2013/08/18 11:40:24
Sort of. I was part-cloning the similar thing for
| |
65 static void DispatchOnLaunchedEventWithURL( | |
66 Profile* profile, | |
67 const Extension* extension, | |
68 const std::string& handler_id, | |
69 const GURL& url, | |
70 const GURL& referrer_url); | |
58 }; | 71 }; |
59 | 72 |
60 } // namespace extensions | 73 } // namespace extensions |
61 | 74 |
62 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 75 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
OLD | NEW |