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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "extensions/common/constants.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class DictionaryValue; | 17 class DictionaryValue; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 class BrowserContext; | 21 class BrowserContext; |
21 class WebContents; | 22 class WebContents; |
22 } | 23 } |
23 | 24 |
24 namespace extensions { | 25 namespace extensions { |
25 | 26 |
26 class Extension; | 27 class Extension; |
27 struct GrantedFileEntry; | 28 struct GrantedFileEntry; |
28 | 29 |
29 class AppRuntimeEventRouter { | 30 class AppRuntimeEventRouter { |
30 public: | 31 public: |
31 // Dispatches the onEmbedRequested event to the given app. | 32 // Dispatches the onEmbedRequested event to the given app. |
32 static void DispatchOnEmbedRequestedEvent( | 33 static void DispatchOnEmbedRequestedEvent( |
33 content::BrowserContext* context, | 34 content::BrowserContext* context, |
34 scoped_ptr<base::DictionaryValue> app_embedding_request_data, | 35 scoped_ptr<base::DictionaryValue> app_embedding_request_data, |
35 const extensions::Extension* extension); | 36 const extensions::Extension* extension); |
36 | 37 |
37 // Dispatches the onLaunched event to the given app. | 38 // Dispatches the onLaunched event to the given app. |
38 static void DispatchOnLaunchedEvent(content::BrowserContext* context, | 39 static void DispatchOnLaunchedEvent(content::BrowserContext* context, |
39 const Extension* extension); | 40 const Extension* extension, |
| 41 extensions::AppLaunchSource source); |
40 | 42 |
41 // Dispatches the onRestarted event to the given app, providing a list of | 43 // Dispatches the onRestarted event to the given app, providing a list of |
42 // restored file entries from the previous run. | 44 // restored file entries from the previous run. |
43 static void DispatchOnRestartedEvent(content::BrowserContext* context, | 45 static void DispatchOnRestartedEvent(content::BrowserContext* context, |
44 const Extension* extension); | 46 const Extension* extension); |
45 | 47 |
46 // TODO(benwells): Update this comment, it is out of date. | 48 // TODO(benwells): Update this comment, it is out of date. |
47 // Dispatches the onLaunched event to the given app, providing launch data of | 49 // Dispatches the onLaunched event to the given app, providing launch data of |
48 // the form: | 50 // the form: |
49 // { | 51 // { |
(...skipping 20 matching lines...) Expand all Loading... |
70 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, | 72 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, |
71 const Extension* extension, | 73 const Extension* extension, |
72 const std::string& handler_id, | 74 const std::string& handler_id, |
73 const GURL& url, | 75 const GURL& url, |
74 const GURL& referrer_url); | 76 const GURL& referrer_url); |
75 }; | 77 }; |
76 | 78 |
77 } // namespace extensions | 79 } // namespace extensions |
78 | 80 |
79 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 81 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
OLD | NEW |