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

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

Issue 133073014: Dispatch chrome.app.runtime.onRestarted to ephemeral apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h" 5 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 DispatchOnLaunchedEventImpl(extension->id(), launch_data.Pass(), profile); 63 DispatchOnLaunchedEventImpl(extension->id(), launch_data.Pass(), profile);
64 } 64 }
65 65
66 // static. 66 // static.
67 void AppEventRouter::DispatchOnRestartedEvent(Profile* profile, 67 void AppEventRouter::DispatchOnRestartedEvent(Profile* profile,
68 const Extension* extension) { 68 const Extension* extension) {
69 scoped_ptr<base::ListValue> arguments(new base::ListValue()); 69 scoped_ptr<base::ListValue> arguments(new base::ListValue());
70 scoped_ptr<Event> event(new Event(app_runtime::OnRestarted::kEventName, 70 scoped_ptr<Event> event(new Event(app_runtime::OnRestarted::kEventName,
71 arguments.Pass())); 71 arguments.Pass()));
72 event->restrict_to_browser_context = profile; 72 event->restrict_to_browser_context = profile;
73 event->can_load_ephemeral_apps = true;
73 extensions::ExtensionSystem::Get(profile)->event_router()-> 74 extensions::ExtensionSystem::Get(profile)->event_router()->
74 DispatchEventToExtension(extension->id(), event.Pass()); 75 DispatchEventToExtension(extension->id(), event.Pass());
75 } 76 }
76 77
77 // static. 78 // static.
78 void AppEventRouter::DispatchOnLaunchedEventWithFileEntry( 79 void AppEventRouter::DispatchOnLaunchedEventWithFileEntry(
79 Profile* profile, const Extension* extension, 80 Profile* profile, const Extension* extension,
80 const std::string& handler_id, const std::string& mime_type, 81 const std::string& handler_id, const std::string& mime_type,
81 const extensions::app_file_handler_util::GrantedFileEntry& file_entry) { 82 const extensions::app_file_handler_util::GrantedFileEntry& file_entry) {
82 // TODO(sergeygs): Use the same way of creating an event (using the generated 83 // TODO(sergeygs): Use the same way of creating an event (using the generated
(...skipping 20 matching lines...) Expand all
103 const GURL& referrer_url) { 104 const GURL& referrer_url) {
104 api::app_runtime::LaunchData launch_data; 105 api::app_runtime::LaunchData launch_data;
105 launch_data.id.reset(new std::string(handler_id)); 106 launch_data.id.reset(new std::string(handler_id));
106 launch_data.url.reset(new std::string(url.spec())); 107 launch_data.url.reset(new std::string(url.spec()));
107 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); 108 launch_data.referrer_url.reset(new std::string(referrer_url.spec()));
108 DispatchOnLaunchedEventImpl( 109 DispatchOnLaunchedEventImpl(
109 extension->id(), launch_data.ToValue().Pass(), profile); 110 extension->id(), launch_data.ToValue().Pass(), profile);
110 } 111 }
111 112
112 } // namespace extensions 113 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698