| 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/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 | 489 |
| 490 if (!platform_app_patterns.empty()) { | 490 if (!platform_app_patterns.empty()) { |
| 491 // We have collected a set of platform-app extensions, so let's tell WebKit | 491 // We have collected a set of platform-app extensions, so let's tell WebKit |
| 492 // about them so that it can provide a default stylesheet for them. | 492 // about them so that it can provide a default stylesheet for them. |
| 493 // | 493 // |
| 494 // TODO(miket): consider enhancing WebView to allow removing | 494 // TODO(miket): consider enhancing WebView to allow removing |
| 495 // single stylesheets, or else to edit the pattern set associated | 495 // single stylesheets, or else to edit the pattern set associated |
| 496 // with one. | 496 // with one. |
| 497 RenderThread::Get()->EnsureWebKitInitialized(); |
| 497 WebVector<WebString> patterns; | 498 WebVector<WebString> patterns; |
| 498 patterns.assign(platform_app_patterns); | 499 patterns.assign(platform_app_patterns); |
| 499 WebView::addUserStyleSheet( | 500 WebView::addUserStyleSheet( |
| 500 WebString::fromUTF8(ResourceBundle::GetSharedInstance(). | 501 WebString::fromUTF8(ResourceBundle::GetSharedInstance(). |
| 501 GetRawDataResource(IDR_PLATFORM_APP_CSS, | 502 GetRawDataResource(IDR_PLATFORM_APP_CSS, |
| 502 ui::SCALE_FACTOR_NONE)), | 503 ui::SCALE_FACTOR_NONE)), |
| 503 patterns, | 504 patterns, |
| 504 WebView::UserContentInjectInAllFrames, | 505 WebView::UserContentInjectInAllFrames, |
| 505 WebView::UserStyleInjectInExistingDocuments); | 506 WebView::UserStyleInjectInExistingDocuments); |
| 506 } | 507 } |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 // we should abort. | 1111 // we should abort. |
| 1111 WebKit::WebFrame* frame = context->web_frame(); | 1112 WebKit::WebFrame* frame = context->web_frame(); |
| 1112 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1113 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
| 1113 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1114 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
| 1114 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1115 CHECK(!extensions_.IsSandboxedPage(url_info)); |
| 1115 | 1116 |
| 1116 return true; | 1117 return true; |
| 1117 } | 1118 } |
| 1118 | 1119 |
| 1119 } // namespace extensions | 1120 } // namespace extensions |
| OLD | NEW |