OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
6 #define EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 6 #define EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "extensions/common/constants.h" | 12 #include "extensions/common/constants.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class DictionaryValue; | 17 class DictionaryValue; |
18 } | 18 } |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class BrowserContext; | 21 class BrowserContext; |
22 class WebContents; | 22 class WebContents; |
23 } | 23 } |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 | 26 |
27 namespace api { | 27 namespace api { |
28 namespace app_runtime { | 28 namespace app_runtime { |
29 struct ActionData; | 29 struct ActionData; |
| 30 struct LaunchData; |
30 } | 31 } |
31 } | 32 } |
32 | 33 |
33 class Extension; | 34 class Extension; |
34 struct EntryInfo; | 35 struct EntryInfo; |
35 struct GrantedFileEntry; | 36 struct GrantedFileEntry; |
36 | 37 |
37 class AppRuntimeEventRouter { | 38 class AppRuntimeEventRouter { |
38 public: | 39 public: |
39 // Dispatches the onEmbedRequested event to the given app. | 40 // Dispatches the onEmbedRequested event to the given app. |
40 static void DispatchOnEmbedRequestedEvent( | 41 static void DispatchOnEmbedRequestedEvent( |
41 content::BrowserContext* context, | 42 content::BrowserContext* context, |
42 std::unique_ptr<base::DictionaryValue> app_embedding_request_data, | 43 std::unique_ptr<base::DictionaryValue> app_embedding_request_data, |
43 const Extension* extension); | 44 const Extension* extension); |
44 | 45 |
45 // Dispatches the onLaunched event to the given app. | 46 // Dispatches the onLaunched event to the given app. |
46 static void DispatchOnLaunchedEvent( | 47 static void DispatchOnLaunchedEvent( |
47 content::BrowserContext* context, | 48 content::BrowserContext* context, |
48 const Extension* extension, | 49 const Extension* extension, |
49 AppLaunchSource source, | 50 AppLaunchSource source, |
50 std::unique_ptr<api::app_runtime::ActionData> action_data); | 51 std::unique_ptr<api::app_runtime::LaunchData> launch_data); |
51 | 52 |
52 // Dispatches the onRestarted event to the given app, providing a list of | 53 // Dispatches the onRestarted event to the given app, providing a list of |
53 // restored file entries from the previous run. | 54 // restored file entries from the previous run. |
54 static void DispatchOnRestartedEvent(content::BrowserContext* context, | 55 static void DispatchOnRestartedEvent(content::BrowserContext* context, |
55 const Extension* extension); | 56 const Extension* extension); |
56 | 57 |
57 // TODO(benwells): Update this comment, it is out of date. | 58 // TODO(benwells): Update this comment, it is out of date. |
58 // Dispatches the onLaunched event to the given app, providing launch data of | 59 // Dispatches the onLaunched event to the given app, providing launch data of |
59 // the form: | 60 // the form: |
60 // { | 61 // { |
(...skipping 22 matching lines...) Expand all Loading... |
83 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, | 84 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, |
84 const Extension* extension, | 85 const Extension* extension, |
85 const std::string& handler_id, | 86 const std::string& handler_id, |
86 const GURL& url, | 87 const GURL& url, |
87 const GURL& referrer_url); | 88 const GURL& referrer_url); |
88 }; | 89 }; |
89 | 90 |
90 } // namespace extensions | 91 } // namespace extensions |
91 | 92 |
92 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 93 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
OLD | NEW |