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

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: cleaner re swapped out 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
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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) 1310 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded)
1312 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, 1311 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded,
1313 OnDragSourceSystemDragEnded) 1312 OnDragSourceSystemDragEnded)
1314 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) 1313 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings)
1315 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) 1314 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
1316 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) 1315 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
1317 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) 1316 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
1318 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, 1317 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse,
1319 OnEnumerateDirectoryResponse) 1318 OnEnumerateDirectoryResponse)
1320 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse) 1319 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse)
1321 IPC_MESSAGE_HANDLER(ViewMsg_SuppressDialogsUntilSwapOut,
1322 OnSuppressDialogsUntilSwapOut)
1323 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) 1320 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
1324 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) 1321 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged)
1325 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) 1322 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
1326 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) 1323 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement)
1327 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque) 1324 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque)
1328 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, 1325 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode,
1329 OnEnablePreferredSizeChangedMode) 1326 OnEnablePreferredSizeChangedMode)
1330 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) 1327 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize)
1331 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) 1328 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize)
1332 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, 1329 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows,
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2536 if (webview() && webview()->mainFrame()->isWebLocalFrame()) 2533 if (webview() && webview()->mainFrame()->isWebLocalFrame())
2537 webview()->mainFrame()->toWebLocalFrame()->sendOrientationChangeEvent(); 2534 webview()->mainFrame()->toWebLocalFrame()->sendOrientationChangeEvent();
2538 } 2535 }
2539 2536
2540 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location, 2537 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location,
2541 const WebPluginAction& action) { 2538 const WebPluginAction& action) {
2542 if (webview()) 2539 if (webview())
2543 webview()->performPluginAction(action, location); 2540 webview()->performPluginAction(action, location);
2544 } 2541 }
2545 2542
2546 void RenderViewImpl::OnSuppressDialogsUntilSwapOut() {
2547 // Don't show any more dialogs until we finish OnSwapOut.
2548 suppress_dialogs_until_swap_out_ = true;
2549 }
2550
2551 void RenderViewImpl::OnClosePage() { 2543 void RenderViewImpl::OnClosePage() {
2552 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); 2544 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage());
2553 // TODO(creis): We'd rather use webview()->Close() here, but that currently 2545 // TODO(creis): We'd rather use webview()->Close() here, but that currently
2554 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs 2546 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs
2555 // in the onunload handler from appearing. For now, we're bypassing that and 2547 // in the onunload handler from appearing. For now, we're bypassing that and
2556 // calling the FrameLoader's CloseURL method directly. This should be 2548 // calling the FrameLoader's CloseURL method directly. This should be
2557 // revisited to avoid having two ways to close a page. Having a single way 2549 // revisited to avoid having two ways to close a page. Having a single way
2558 // to close that can run onunload is also useful for fixing 2550 // to close that can run onunload is also useful for fixing
2559 // http://b/issue?id=753080. 2551 // http://b/issue?id=753080.
2560 webview()->mainFrame()->dispatchUnloadEvent(); 2552 webview()->mainFrame()->dispatchUnloadEvent();
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 if (IsUseZoomForDSFEnabled()) { 3303 if (IsUseZoomForDSFEnabled()) {
3312 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3304 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3313 } else { 3305 } else {
3314 webview()->setDeviceScaleFactor(device_scale_factor_); 3306 webview()->setDeviceScaleFactor(device_scale_factor_);
3315 } 3307 }
3316 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3308 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3317 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3309 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3318 } 3310 }
3319 3311
3320 } // namespace content 3312 } // namespace content
OLDNEW
« content/renderer/render_frame_impl.cc ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698