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

Side by Side Diff: extensions/browser/api/app_runtime/app_runtime_api.h

Issue 657023008: Add a new field "source" in launchData of chrome.app.runtime.onLaunched() to trace launch source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
OLDNEW
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,
benwells 2014/10/21 03:51:58 Again, can we augment this function instead of cre
cylee1 2014/10/21 13:41:16 Done.
39 const Extension* extension); 40 const Extension* extension);
40 41
42 // Dispatches the onLaunched event to the given app with source parameters.
43 static void DispatchOnLaunchedEventWithSource(
44 content::BrowserContext* context,
45 const Extension* extension,
46 extensions::AppLaunchSource source);
47
41 // Dispatches the onRestarted event to the given app, providing a list of 48 // Dispatches the onRestarted event to the given app, providing a list of
42 // restored file entries from the previous run. 49 // restored file entries from the previous run.
43 static void DispatchOnRestartedEvent(content::BrowserContext* context, 50 static void DispatchOnRestartedEvent(content::BrowserContext* context,
44 const Extension* extension); 51 const Extension* extension);
45 52
46 // TODO(benwells): Update this comment, it is out of date. 53 // TODO(benwells): Update this comment, it is out of date.
47 // Dispatches the onLaunched event to the given app, providing launch data of 54 // Dispatches the onLaunched event to the given app, providing launch data of
48 // the form: 55 // the form:
49 // { 56 // {
50 // "intent" : { 57 // "intent" : {
(...skipping 19 matching lines...) Expand all
70 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context, 77 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context,
71 const Extension* extension, 78 const Extension* extension,
72 const std::string& handler_id, 79 const std::string& handler_id,
73 const GURL& url, 80 const GURL& url,
74 const GURL& referrer_url); 81 const GURL& referrer_url);
75 }; 82 };
76 83
77 } // namespace extensions 84 } // namespace extensions
78 85
79 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_ 86 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698