Add ICU message format support
[chromium-blink-merge.git] / extensions / browser / api / app_runtime / app_runtime_api.h
blob38f6fd6193cddfa3a4d5e8f75135d000fc2eff10
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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_
6 #define EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_
8 #include <string>
9 #include <vector>
11 #include "base/memory/scoped_ptr.h"
12 #include "extensions/common/constants.h"
14 class GURL;
16 namespace base {
17 class DictionaryValue;
20 namespace content {
21 class BrowserContext;
22 class WebContents;
25 namespace extensions {
27 class Extension;
28 struct GrantedFileEntry;
30 class AppRuntimeEventRouter {
31 public:
32 // Dispatches the onEmbedRequested event to the given app.
33 static void DispatchOnEmbedRequestedEvent(
34 content::BrowserContext* context,
35 scoped_ptr<base::DictionaryValue> app_embedding_request_data,
36 const extensions::Extension* extension);
38 // Dispatches the onLaunched event to the given app.
39 static void DispatchOnLaunchedEvent(content::BrowserContext* context,
40 const Extension* extension,
41 extensions::AppLaunchSource source);
43 // Dispatches the onRestarted event to the given app, providing a list of
44 // restored file entries from the previous run.
45 static void DispatchOnRestartedEvent(content::BrowserContext* context,
46 const Extension* extension);
48 // TODO(benwells): Update this comment, it is out of date.
49 // Dispatches the onLaunched event to the given app, providing launch data of
50 // the form:
51 // {
52 // "intent" : {
53 // "type" : "chrome-extension://fileentry",
54 // "data" : a FileEntry,
55 // "postResults" : a null function,
56 // "postFailure" : a null function
57 // }
58 // }
60 // The FileEntries are created from |file_system_id| and |base_name|.
61 // |handler_id| corresponds to the id of the file_handlers item in the
62 // manifest that resulted in a match which triggered this launch.
63 static void DispatchOnLaunchedEventWithFileEntries(
64 content::BrowserContext* context,
65 const Extension* extension,
66 const std::string& handler_id,
67 const std::vector<std::string>& mime_types,
68 const std::vector<GrantedFileEntry>& file_entries);
70 // |handler_id| corresponds to the id of the url_handlers item
71 // in the manifest that resulted in a match which triggered this launch.
72 static void DispatchOnLaunchedEventWithUrl(content::BrowserContext* context,
73 const Extension* extension,
74 const std::string& handler_id,
75 const GURL& url,
76 const GURL& referrer_url);
79 } // namespace extensions
81 #endif // EXTENSIONS_BROWSER_API_APP_RUNTIME_APP_RUNTIME_API_H_