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/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 // insert the default platform app stylesheet into all documents that are | 1267 // insert the default platform app stylesheet into all documents that are |
1268 // loaded in each app. | 1268 // loaded in each app. |
1269 std::string stylesheet = | 1269 std::string stylesheet = |
1270 ResourceBundle::GetSharedInstance(). | 1270 ResourceBundle::GetSharedInstance(). |
1271 GetRawDataResource(IDR_PLATFORM_APP_CSS).as_string(); | 1271 GetRawDataResource(IDR_PLATFORM_APP_CSS).as_string(); |
1272 ReplaceFirstSubstringAfterOffset(&stylesheet, 0, | 1272 ReplaceFirstSubstringAfterOffset(&stylesheet, 0, |
1273 "$FONTFAMILY", system_font_family_); | 1273 "$FONTFAMILY", system_font_family_); |
1274 ReplaceFirstSubstringAfterOffset(&stylesheet, 0, | 1274 ReplaceFirstSubstringAfterOffset(&stylesheet, 0, |
1275 "$FONTSIZE", system_font_size_); | 1275 "$FONTSIZE", system_font_size_); |
1276 frame->document().insertUserStyleSheet( | 1276 frame->document().insertUserStyleSheet( |
1277 WebString::fromUTF8(stylesheet), WebDocument::UserStyleUserLevel); | 1277 WebString::fromUTF8(stylesheet), WebDocument::UserStyleAuthorLevel); |
1278 } | 1278 } |
1279 | 1279 |
1280 content_watcher_->DidCreateDocumentElement(frame); | 1280 content_watcher_->DidCreateDocumentElement(frame); |
1281 } | 1281 } |
1282 | 1282 |
1283 void Dispatcher::DidMatchCSS( | 1283 void Dispatcher::DidMatchCSS( |
1284 blink::WebFrame* frame, | 1284 blink::WebFrame* frame, |
1285 const blink::WebVector<blink::WebString>& newly_matching_selectors, | 1285 const blink::WebVector<blink::WebString>& newly_matching_selectors, |
1286 const blink::WebVector<blink::WebString>& stopped_matching_selectors) { | 1286 const blink::WebVector<blink::WebString>& stopped_matching_selectors) { |
1287 content_watcher_->DidMatchCSS( | 1287 content_watcher_->DidMatchCSS( |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 RenderView* background_view = | 1632 RenderView* background_view = |
1633 ExtensionHelper::GetBackgroundPage(extension_id); | 1633 ExtensionHelper::GetBackgroundPage(extension_id); |
1634 if (background_view) { | 1634 if (background_view) { |
1635 background_view->Send(new ExtensionHostMsg_EventAck( | 1635 background_view->Send(new ExtensionHostMsg_EventAck( |
1636 background_view->GetRoutingID())); | 1636 background_view->GetRoutingID())); |
1637 } | 1637 } |
1638 } | 1638 } |
1639 } | 1639 } |
1640 | 1640 |
1641 } // namespace extensions | 1641 } // namespace extensions |
OLD | NEW |