Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 807583006: Fix ChromeRenderViewObserver::DidStopLoading to be OOPIF compatible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return early for remote frames. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698