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

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

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 1) Fixed broken redirection for in-page WebKit-initiated navigations. All redirections work now. 2)… Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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 // The FileEntry is created from |file_system_id| and |base_name|.
49 // custom dispatch event in javascript. The FileEntry is created from 52 // |handler_id| corresponds to the id of the file_handlers item in the
50 // |file_system_id| and |base_name|. 53 // manifest that resulted in a match which triggered this launch.
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 // |handler_id| corresponds to the id of the url_handlers item
63 // in the manifest that resulted in a match which triggered this launch.
64 static void DispatchOnLaunchedEventWithURL(
65 Profile* profile,
66 const Extension* extension,
67 const std::string& handler_id,
68 const GURL& url,
69 const GURL& referrer_url);
58 }; 70 };
59 71
60 } // namespace extensions 72 } // namespace extensions
61 73
62 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ 74 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698