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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 16026006: Introduce the notion of a "layout test mode" instead of turning individual flags on and off (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 value.utf8())); 2513 value.utf8()));
2514 } 2514 }
2515 2515
2516 // WebKit::WebWidgetClient ---------------------------------------------------- 2516 // WebKit::WebWidgetClient ----------------------------------------------------
2517 2517
2518 void RenderViewImpl::didFocus() { 2518 void RenderViewImpl::didFocus() {
2519 // TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed 2519 // TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed
2520 // we won't have to test for user gesture anymore and we can 2520 // we won't have to test for user gesture anymore and we can
2521 // move that code back to render_widget.cc 2521 // move that code back to render_widget.cc
2522 if (WebUserGestureIndicator::isProcessingUserGesture() && 2522 if (WebUserGestureIndicator::isProcessingUserGesture() &&
2523 RenderThreadImpl::current()->should_send_focus_ipcs()) { 2523 !RenderThreadImpl::current()->layout_test_mode()) {
2524 Send(new ViewHostMsg_Focus(routing_id_)); 2524 Send(new ViewHostMsg_Focus(routing_id_));
2525 } 2525 }
2526 } 2526 }
2527 2527
2528 void RenderViewImpl::didBlur() { 2528 void RenderViewImpl::didBlur() {
2529 // TODO(jcivelli): see TODO above in didFocus(). 2529 // TODO(jcivelli): see TODO above in didFocus().
2530 if (WebUserGestureIndicator::isProcessingUserGesture() && 2530 if (WebUserGestureIndicator::isProcessingUserGesture() &&
2531 RenderThreadImpl::current()->should_send_focus_ipcs()) { 2531 !RenderThreadImpl::current()->layout_test_mode()) {
2532 Send(new ViewHostMsg_Blur(routing_id_)); 2532 Send(new ViewHostMsg_Blur(routing_id_));
2533 } 2533 }
2534 } 2534 }
2535 2535
2536 // We are supposed to get a single call to Show for a newly created RenderView 2536 // We are supposed to get a single call to Show for a newly created RenderView
2537 // that was created via RenderViewImpl::CreateWebView. So, we wait until this 2537 // that was created via RenderViewImpl::CreateWebView. So, we wait until this
2538 // point to dispatch the ShowView message. 2538 // point to dispatch the ShowView message.
2539 // 2539 //
2540 // This method provides us with the information about how to display the newly 2540 // This method provides us with the information about how to display the newly
2541 // created RenderView (i.e., as a blocked popup or as a new tab). 2541 // created RenderView (i.e., as a blocked popup or as a new tab).
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
3484 params.url = error.unreachableURL; 3484 params.url = error.unreachableURL;
3485 params.showing_repost_interstitial = show_repost_interstitial; 3485 params.showing_repost_interstitial = show_repost_interstitial;
3486 Send(new ViewHostMsg_DidFailProvisionalLoadWithError( 3486 Send(new ViewHostMsg_DidFailProvisionalLoadWithError(
3487 routing_id_, params)); 3487 routing_id_, params));
3488 3488
3489 // Don't display an error page if this is simply a cancelled load. Aside 3489 // Don't display an error page if this is simply a cancelled load. Aside
3490 // from being dumb, WebCore doesn't expect it and it will cause a crash. 3490 // from being dumb, WebCore doesn't expect it and it will cause a crash.
3491 if (error.reason == net::ERR_ABORTED) 3491 if (error.reason == net::ERR_ABORTED)
3492 return; 3492 return;
3493 3493
3494 if (RenderThreadImpl::current()->skip_error_pages()) 3494 if (RenderThreadImpl::current()->layout_test_mode())
3495 return; 3495 return;
3496 3496
3497 // Make sure we never show errors in view source mode. 3497 // Make sure we never show errors in view source mode.
3498 frame->enableViewSourceMode(false); 3498 frame->enableViewSourceMode(false);
3499 3499
3500 DocumentState* document_state = DocumentState::FromDataSource(ds); 3500 DocumentState* document_state = DocumentState::FromDataSource(ds);
3501 NavigationState* navigation_state = document_state->navigation_state(); 3501 NavigationState* navigation_state = document_state->navigation_state();
3502 3502
3503 // If this is a failed back/forward/reload navigation, then we need to do a 3503 // If this is a failed back/forward/reload navigation, then we need to do a
3504 // 'replace' load. This is necessary to avoid messing up session history. 3504 // 'replace' load. This is necessary to avoid messing up session history.
(...skipping 3056 matching lines...) Expand 10 before | Expand all | Expand 10 after
6561 WebURL url = icon_urls[i].iconURL(); 6561 WebURL url = icon_urls[i].iconURL();
6562 if (!url.isEmpty()) 6562 if (!url.isEmpty())
6563 urls.push_back(FaviconURL(url, 6563 urls.push_back(FaviconURL(url,
6564 ToFaviconType(icon_urls[i].iconType()))); 6564 ToFaviconType(icon_urls[i].iconType())));
6565 } 6565 }
6566 SendUpdateFaviconURL(urls); 6566 SendUpdateFaviconURL(urls);
6567 } 6567 }
6568 6568
6569 6569
6570 } // namespace content 6570 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698