Index: extensions/renderer/dispatcher.cc |
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc |
index d52d1505c06bfe2a7da38acde2639c831bf5fa29..c98e4a3365d152ba312953df6b5e899077af977d 100644 |
--- a/extensions/renderer/dispatcher.cc |
+++ b/extensions/renderer/dispatcher.cc |
@@ -32,6 +32,7 @@ |
#include "extensions/common/manifest_constants.h" |
#include "extensions/common/manifest_handlers/background_info.h" |
#include "extensions/common/manifest_handlers/externally_connectable.h" |
+#include "extensions/common/manifest_handlers/options_page_info.h" |
#include "extensions/common/manifest_handlers/sandboxed_page_info.h" |
#include "extensions/common/message_bundle.h" |
#include "extensions/common/permissions/permission_set.h" |
@@ -332,13 +333,14 @@ void Dispatcher::DidCreateDocumentElement(blink::WebFrame* frame) { |
// are hosted in the extension process. |
GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL( |
frame, frame->document().url(), true /* match_about_blank */); |
+ |
const Extension* extension = |
extensions_.GetExtensionOrAppByURL(effective_document_url); |
if (extension && |
(extension->is_extension() || extension->is_platform_app())) { |
- int resource_id = |
- extension->is_platform_app() ? IDR_PLATFORM_APP_CSS : IDR_EXTENSION_CSS; |
+ int resource_id = extension->is_platform_app() ? IDR_PLATFORM_APP_CSS |
+ : IDR_EXTENSION_FONTS_CSS; |
std::string stylesheet = ResourceBundle::GetSharedInstance() |
.GetRawDataResource(resource_id) |
.as_string(); |
@@ -352,6 +354,15 @@ void Dispatcher::DidCreateDocumentElement(blink::WebFrame* frame) { |
// documents that are loaded in each app or extension. |
frame->document().insertStyleSheet(WebString::fromUTF8(stylesheet)); |
} |
+ |
+ if (extension && extension->is_extension() && |
+ OptionsPageInfo::ShouldUseChromeStyle(extension) && |
+ effective_document_url == OptionsPageInfo::GetOptionsPage(extension)) { |
Devlin
2014/09/04 21:27:37
Is this data copied over to the renderer process?
ericzeng
2014/09/04 22:30:30
I don't know either. Which data in particular?
Devlin
2014/09/04 22:39:19
The extension's manifest data for whether or not i
ericzeng
2014/09/04 23:48:58
I'm pretty sure that it is - the IPC call when ext
Yoyo Zhou
2014/09/05 16:24:35
Yes, the renderer ought to have all the manifest d
|
+ frame->document().insertStyleSheet( |
+ WebString::fromUTF8(ResourceBundle::GetSharedInstance() |
+ .GetRawDataResource(IDR_EXTENSION_CSS) |
Devlin
2014/09/04 21:27:37
Naively looking at this, it seems that you inject
ericzeng
2014/09/04 22:30:30
I think the conditional above should catch it - it
Devlin
2014/09/04 22:39:19
D'oh. Don't know why I missed that.
|
+ .as_string())); |
+ } |
content_watcher_->DidCreateDocumentElement(frame); |
} |