| OLD | NEW |
| 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 Loading... |
| 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 static void DispatchOnRestartedEvent( | 31 static void DispatchOnRestartedEvent(Profile* profile, |
| 32 Profile* profile, | 32 const Extension* extension); |
| 33 const Extension* extension, | |
| 34 const std::vector<app_file_handler_util::GrantedFileEntry>& file_entries); | |
| 35 | 33 |
| 36 // TODO(benwells): Update this comment, it is out of date. | 34 // TODO(benwells): Update this comment, it is out of date. |
| 37 // Dispatches the onLaunched event to the given app, providing launch data of | 35 // Dispatches the onLaunched event to the given app, providing launch data of |
| 38 // the form: | 36 // the form: |
| 39 // { | 37 // { |
| 40 // "intent" : { | 38 // "intent" : { |
| 41 // "type" : "chrome-extension://fileentry", | 39 // "type" : "chrome-extension://fileentry", |
| 42 // "data" : a FileEntry, | 40 // "data" : a FileEntry, |
| 43 // "postResults" : a null function, | 41 // "postResults" : a null function, |
| 44 // "postFailure" : a null function | 42 // "postFailure" : a null function |
| 45 // } | 43 // } |
| 46 // } | 44 // } |
| 47 | 45 |
| 48 // launchData.intent.data and launchData.intent.postResults are created in a | 46 // launchData.intent.data and launchData.intent.postResults are created in a |
| 49 // custom dispatch event in javascript. The FileEntry is created from | 47 // custom dispatch event in javascript. The FileEntry is created from |
| 50 // |file_system_id| and |base_name|. | 48 // |file_system_id| and |base_name|. |
| 51 static void DispatchOnLaunchedEventWithFileEntry( | 49 static void DispatchOnLaunchedEventWithFileEntry( |
| 52 Profile* profile, | 50 Profile* profile, |
| 53 const Extension* extension, | 51 const Extension* extension, |
| 54 const std::string& handler_id, | 52 const std::string& handler_id, |
| 55 const std::string& mime_type, | 53 const std::string& mime_type, |
| 56 const extensions::app_file_handler_util::GrantedFileEntry& file_entry); | 54 const extensions::app_file_handler_util::GrantedFileEntry& file_entry); |
| 57 }; | 55 }; |
| 58 | 56 |
| 59 } // namespace extensions | 57 } // namespace extensions |
| 60 | 58 |
| 61 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ | 59 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_RUNTIME_APP_RUNTIME_API_H_ |
| OLD | NEW |