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; | |
31 } | 30 } |
32 } | 31 } |
33 | 32 |
34 class Extension; | 33 class Extension; |
35 struct EntryInfo; | 34 struct EntryInfo; |
36 struct GrantedFileEntry; | 35 struct GrantedFileEntry; |
37 | 36 |
38 class AppRuntimeEventRouter { | 37 class AppRuntimeEventRouter { |
39 public: | 38 public: |
40 // Dispatches the onEmbedRequested event to the given app. | 39 // Dispatches the onEmbedRequested event to the given app. |
41 static void DispatchOnEmbedRequestedEvent( | 40 static void DispatchOnEmbedRequestedEvent( |
42 content::BrowserContext* context, | 41 content::BrowserContext* context, |
43 std::unique_ptr<base::DictionaryValue> app_embedding_request_data, | 42 std::unique_ptr<base::DictionaryValue> app_embedding_request_data, |
44 const Extension* extension); | 43 const Extension* extension); |
45 | 44 |
46 // Dispatches the onLaunched event to the given app. | 45 // Dispatches the onLaunched event to the given app. |
47 static void DispatchOnLaunchedEvent( | 46 static void DispatchOnLaunchedEvent( |
48 content::BrowserContext* context, | 47 content::BrowserContext* context, |
49 const Extension* extension, | 48 const Extension* extension, |
50 AppLaunchSource source, | 49 AppLaunchSource source, |
51 std::unique_ptr<api::app_runtime::LaunchData> launch_data); | 50 std::unique_ptr<api::app_runtime::ActionData> action_data); |
52 | 51 |
53 // Dispatches the onRestarted event to the given app, providing a list of | 52 // Dispatches the onRestarted event to the given app, providing a list of |
54 // restored file entries from the previous run. | 53 // restored file entries from the previous run. |
55 static void DispatchOnRestartedEvent(content::BrowserContext* context, | 54 static void DispatchOnRestartedEvent(content::BrowserContext* context, |
56 const Extension* extension); | 55 const Extension* extension); |
57 | 56 |
58 // TODO(benwells): Update this comment, it is out of date. | 57 // TODO(benwells): Update this comment, it is out of date. |
59 // Dispatches the onLaunched event to the given app, providing launch data of | 58 // Dispatches the onLaunched event to the given app, providing launch data of |
60 // the form: | 59 // the form: |
61 // { | 60 // { |
(...skipping 22 matching lines...) Expand all Loading... |
84 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, | 83 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, |
85 const Extension* extension, | 84 const Extension* extension, |
86 const std::string& handler_id, | 85 const std::string& handler_id, |
87 const GURL& url, | 86 const GURL& url, |
88 const GURL& referrer_url); | 87 const GURL& referrer_url); |
89 }; | 88 }; |
90 | 89 |
91 } // namespace extensions | 90 } // namespace extensions |
92 | 91 |
93 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 92 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
OLD | NEW |