OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "extensions/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 // using Chrome styles, then insert the Chrome extension stylesheet. | 354 // using Chrome styles, then insert the Chrome extension stylesheet. |
355 if (extension && extension->is_extension() && | 355 if (extension && extension->is_extension() && |
356 OptionsPageInfo::ShouldUseChromeStyle(extension) && | 356 OptionsPageInfo::ShouldUseChromeStyle(extension) && |
357 effective_document_url == OptionsPageInfo::GetOptionsPage(extension)) { | 357 effective_document_url == OptionsPageInfo::GetOptionsPage(extension)) { |
358 frame->document().insertStyleSheet( | 358 frame->document().insertStyleSheet( |
359 WebString::fromUTF8(ResourceBundle::GetSharedInstance() | 359 WebString::fromUTF8(ResourceBundle::GetSharedInstance() |
360 .GetRawDataResource(IDR_EXTENSION_CSS) | 360 .GetRawDataResource(IDR_EXTENSION_CSS) |
361 .as_string())); | 361 .as_string())); |
362 } | 362 } |
363 | 363 |
364 content_watcher_->DidCreateDocumentElement(frame); | 364 // In testing, the document lifetime events can happen after the render |
| 365 // process shutdown event. |
| 366 // See: http://crbug.com/21508 and http://crbug.com/500851 |
| 367 if (content_watcher_) { |
| 368 content_watcher_->DidCreateDocumentElement(frame); |
| 369 } |
365 } | 370 } |
366 | 371 |
367 void Dispatcher::OnExtensionResponse(int request_id, | 372 void Dispatcher::OnExtensionResponse(int request_id, |
368 bool success, | 373 bool success, |
369 const base::ListValue& response, | 374 const base::ListValue& response, |
370 const std::string& error) { | 375 const std::string& error) { |
371 request_sender_->HandleResponse(request_id, success, response, error); | 376 request_sender_->HandleResponse(request_id, success, response, error); |
372 } | 377 } |
373 | 378 |
374 void Dispatcher::DispatchEvent(const std::string& extension_id, | 379 void Dispatcher::DispatchEvent(const std::string& extension_id, |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 // The "guestViewDeny" module must always be loaded last. It registers | 1439 // The "guestViewDeny" module must always be loaded last. It registers |
1435 // error-providing custom elements for the GuestView types that are not | 1440 // error-providing custom elements for the GuestView types that are not |
1436 // available, and thus all of those types must have been checked and loaded | 1441 // available, and thus all of those types must have been checked and loaded |
1437 // (or not loaded) beforehand. | 1442 // (or not loaded) beforehand. |
1438 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1443 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
1439 module_system->Require("guestViewDeny"); | 1444 module_system->Require("guestViewDeny"); |
1440 } | 1445 } |
1441 } | 1446 } |
1442 | 1447 |
1443 } // namespace extensions | 1448 } // namespace extensions |
OLD | NEW |