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 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h" | 5 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ExtensionTabUtil::GetTabId(web_contents()))); | 269 ExtensionTabUtil::GetTabId(web_contents()))); |
270 args.Append(changed_properties); | 270 args.Append(changed_properties); |
271 args.Append(CreateValue()); | 271 args.Append(CreateValue()); |
272 std::string json_args; | 272 std::string json_args; |
273 base::JSONWriter::Write(&args, &json_args); | 273 base::JSONWriter::Write(&args, &json_args); |
274 | 274 |
275 // The event router only dispatches the event to renderers listening for the | 275 // The event router only dispatches the event to renderers listening for the |
276 // event. | 276 // event. |
277 Profile* profile = parent_tab_->tab_contents()->profile(); | 277 Profile* profile = parent_tab_->tab_contents()->profile(); |
278 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 278 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
279 events::kOnOffscreenTabUpdated, json_args, profile, GURL()); | 279 events::kOnOffscreenTabUpdated, json_args, profile, GURL(), |
| 280 extensions::EventFilteringInfo()); |
280 } | 281 } |
281 | 282 |
282 ParentTab::ParentTab() : tab_contents_wrapper_(NULL) {} | 283 ParentTab::ParentTab() : tab_contents_wrapper_(NULL) {} |
283 ParentTab::~ParentTab() {} | 284 ParentTab::~ParentTab() {} |
284 | 285 |
285 void ParentTab::Init(WebContents* web_contents, | 286 void ParentTab::Init(WebContents* web_contents, |
286 const std::string& extension_id) { | 287 const std::string& extension_id) { |
287 CHECK(web_contents); | 288 CHECK(web_contents); |
288 | 289 |
289 extension_id_ = extension_id; | 290 extension_id_ = extension_id; |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // async case (when a "javascript": URL is sent to a tab). | 833 // async case (when a "javascript": URL is sent to a tab). |
833 if (!is_async) | 834 if (!is_async) |
834 SendResponse(true); | 835 SendResponse(true); |
835 | 836 |
836 return true; | 837 return true; |
837 } | 838 } |
838 | 839 |
839 void UpdateOffscreenTabFunction::PopulateResult() { | 840 void UpdateOffscreenTabFunction::PopulateResult() { |
840 // There's no result associated with this callback. | 841 // There's no result associated with this callback. |
841 } | 842 } |
OLD | NEW |