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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 1799253002: Stricter user gestures for touch - measure and warn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 return frame->isMainFrame(); 271 return frame->isMainFrame();
272 } 272 }
273 273
274 unsigned LocalDOMWindow::pendingUnloadEventListeners() const 274 unsigned LocalDOMWindow::pendingUnloadEventListeners() const
275 { 275 {
276 return windowsWithUnloadEventListeners().count(const_cast<LocalDOMWindow*>(t his)); 276 return windowsWithUnloadEventListeners().count(const_cast<LocalDOMWindow*>(t his));
277 } 277 }
278 278
279 bool LocalDOMWindow::allowPopUp(LocalFrame& firstFrame) 279 bool LocalDOMWindow::allowPopUp(LocalFrame& firstFrame)
280 { 280 {
281 if (UserGestureIndicator::processingUserGesture()) 281 if (UserGestureIndicator::utilizeUserGesture())
282 return true; 282 return true;
283 283
284 Settings* settings = firstFrame.settings(); 284 Settings* settings = firstFrame.settings();
285 return settings && settings->javaScriptCanOpenWindowsAutomatically(); 285 return settings && settings->javaScriptCanOpenWindowsAutomatically();
286 } 286 }
287 287
288 bool LocalDOMWindow::allowPopUp() 288 bool LocalDOMWindow::allowPopUp()
289 { 289 {
290 return frame() && allowPopUp(*frame()); 290 return frame() && allowPopUp(*frame());
291 } 291 }
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 { 1524 {
1525 // If the LocalDOMWindow still has a frame reference, that frame must point 1525 // If the LocalDOMWindow still has a frame reference, that frame must point
1526 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1526 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1527 // where script execution leaks between different LocalDOMWindows. 1527 // where script execution leaks between different LocalDOMWindows.
1528 if (m_frameObserver->frame()) 1528 if (m_frameObserver->frame())
1529 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1529 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1530 return m_frameObserver->frame(); 1530 return m_frameObserver->frame();
1531 } 1531 }
1532 1532
1533 } // namespace blink 1533 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Deprecation.cpp ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698