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

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

Issue 1849013004: Fix JavaScript alerts from frames with oopif on, after a cross-process click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alertfix
Patch Set: fixes Created 4 years, 8 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | 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 "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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 params.initial_size.screen_info, 609 params.initial_size.screen_info,
610 params.swapped_out, 610 params.swapped_out,
611 params.hidden, 611 params.hidden,
612 params.never_visible), 612 params.never_visible),
613 webkit_preferences_(params.web_preferences), 613 webkit_preferences_(params.web_preferences),
614 send_content_state_immediately_(false), 614 send_content_state_immediately_(false),
615 enabled_bindings_(0), 615 enabled_bindings_(0),
616 send_preferred_size_changes_(false), 616 send_preferred_size_changes_(false),
617 navigation_gesture_(NavigationGestureUnknown), 617 navigation_gesture_(NavigationGestureUnknown),
618 opened_by_user_gesture_(true), 618 opened_by_user_gesture_(true),
619 suppress_dialogs_until_swap_out_(false),
620 page_id_(-1), 619 page_id_(-1),
621 next_page_id_(params.next_page_id), 620 next_page_id_(params.next_page_id),
622 history_list_offset_(-1), 621 history_list_offset_(-1),
623 history_list_length_(0), 622 history_list_length_(0),
624 frames_in_progress_(0), 623 frames_in_progress_(0),
625 target_url_status_(TARGET_NONE), 624 target_url_status_(TARGET_NONE),
626 uses_temporary_zoom_level_(false), 625 uses_temporary_zoom_level_(false),
627 #if defined(OS_ANDROID) 626 #if defined(OS_ANDROID)
628 top_controls_constraints_(TOP_CONTROLS_STATE_BOTH), 627 top_controls_constraints_(TOP_CONTROLS_STATE_BOTH),
629 #endif 628 #endif
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) 1312 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded)
1314 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, 1313 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded,
1315 OnDragSourceSystemDragEnded) 1314 OnDragSourceSystemDragEnded)
1316 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) 1315 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings)
1317 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) 1316 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
1318 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) 1317 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
1319 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) 1318 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
1320 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, 1319 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse,
1321 OnEnumerateDirectoryResponse) 1320 OnEnumerateDirectoryResponse)
1322 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse) 1321 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse)
1323 IPC_MESSAGE_HANDLER(ViewMsg_SuppressDialogsUntilSwapOut,
1324 OnSuppressDialogsUntilSwapOut)
1325 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) 1322 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
1326 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) 1323 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged)
1327 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) 1324 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
1328 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) 1325 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement)
1329 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque) 1326 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque)
1330 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, 1327 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode,
1331 OnEnablePreferredSizeChangedMode) 1328 OnEnablePreferredSizeChangedMode)
1332 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) 1329 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize)
1333 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) 1330 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize)
1334 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, 1331 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows,
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 if (webview() && webview()->mainFrame()->isWebLocalFrame()) 2529 if (webview() && webview()->mainFrame()->isWebLocalFrame())
2533 webview()->mainFrame()->toWebLocalFrame()->sendOrientationChangeEvent(); 2530 webview()->mainFrame()->toWebLocalFrame()->sendOrientationChangeEvent();
2534 } 2531 }
2535 2532
2536 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location, 2533 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location,
2537 const WebPluginAction& action) { 2534 const WebPluginAction& action) {
2538 if (webview()) 2535 if (webview())
2539 webview()->performPluginAction(action, location); 2536 webview()->performPluginAction(action, location);
2540 } 2537 }
2541 2538
2542 void RenderViewImpl::OnSuppressDialogsUntilSwapOut() {
2543 // Don't show any more dialogs until we finish OnSwapOut.
2544 suppress_dialogs_until_swap_out_ = true;
2545 }
2546
2547 void RenderViewImpl::OnClosePage() { 2539 void RenderViewImpl::OnClosePage() {
2548 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); 2540 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage());
2549 // TODO(creis): We'd rather use webview()->Close() here, but that currently 2541 // TODO(creis): We'd rather use webview()->Close() here, but that currently
2550 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs 2542 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs
2551 // in the onunload handler from appearing. For now, we're bypassing that and 2543 // in the onunload handler from appearing. For now, we're bypassing that and
2552 // calling the FrameLoader's CloseURL method directly. This should be 2544 // calling the FrameLoader's CloseURL method directly. This should be
2553 // revisited to avoid having two ways to close a page. Having a single way 2545 // revisited to avoid having two ways to close a page. Having a single way
2554 // to close that can run onunload is also useful for fixing 2546 // to close that can run onunload is also useful for fixing
2555 // http://b/issue?id=753080. 2547 // http://b/issue?id=753080.
2556 webview()->mainFrame()->dispatchUnloadEvent(); 2548 webview()->mainFrame()->dispatchUnloadEvent();
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
3307 if (IsUseZoomForDSFEnabled()) { 3299 if (IsUseZoomForDSFEnabled()) {
3308 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3300 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3309 } else { 3301 } else {
3310 webview()->setDeviceScaleFactor(device_scale_factor_); 3302 webview()->setDeviceScaleFactor(device_scale_factor_);
3311 } 3303 }
3312 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3304 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3313 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3305 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3314 } 3306 }
3315 3307
3316 } // namespace content 3308 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698