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/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 for (size_t i = 0; i < webui_javascript_.size(); ++i) { | 327 for (size_t i = 0; i < webui_javascript_.size(); ++i) { |
328 render_view()->GetMainRenderFrame()->ExecuteJavaScript( | 328 render_view()->GetMainRenderFrame()->ExecuteJavaScript( |
329 webui_javascript_[i]); | 329 webui_javascript_[i]); |
330 } | 330 } |
331 webui_javascript_.clear(); | 331 webui_javascript_.clear(); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 void ChromeRenderViewObserver::DidStopLoading() { | 335 void ChromeRenderViewObserver::DidStopLoading() { |
336 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); | 336 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); |
| 337 |
| 338 // Remote frames don't host a document, so return early if that's the case. |
| 339 if (main_frame->isWebRemoteFrame()) |
| 340 return; |
| 341 |
337 GURL osdd_url = main_frame->document().openSearchDescriptionURL(); | 342 GURL osdd_url = main_frame->document().openSearchDescriptionURL(); |
338 if (!osdd_url.is_empty()) { | 343 if (!osdd_url.is_empty()) { |
339 Send(new ChromeViewHostMsg_PageHasOSDD( | 344 Send(new ChromeViewHostMsg_PageHasOSDD( |
340 routing_id(), main_frame->document().url(), osdd_url, | 345 routing_id(), main_frame->document().url(), osdd_url, |
341 search_provider::AUTODETECTED_PROVIDER)); | 346 search_provider::AUTODETECTED_PROVIDER)); |
342 } | 347 } |
343 | 348 |
344 // Don't capture pages including refresh meta tag. | 349 // Don't capture pages including refresh meta tag. |
345 if (HasRefreshMetaTag(main_frame)) | 350 if (HasRefreshMetaTag(main_frame)) |
346 return; | 351 return; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 WebElement element = node.to<WebElement>(); | 477 WebElement element = node.to<WebElement>(); |
473 if (!element.hasHTMLTagName(tag_name)) | 478 if (!element.hasHTMLTagName(tag_name)) |
474 continue; | 479 continue; |
475 WebString value = element.getAttribute(attribute_name); | 480 WebString value = element.getAttribute(attribute_name); |
476 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 481 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
477 continue; | 482 continue; |
478 return true; | 483 return true; |
479 } | 484 } |
480 return false; | 485 return false; |
481 } | 486 } |
OLD | NEW |