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

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

Issue 866983004: Allow creating new windows from a notificationclick event in SW. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 { 893 {
894 if (!frame()) 894 if (!frame())
895 return; 895 return;
896 896
897 FrameHost* host = frame()->host(); 897 FrameHost* host = frame()->host();
898 if (!host) 898 if (!host)
899 return; 899 return;
900 900
901 ASSERT(context); 901 ASSERT(context);
902 902
903 bool allowFocus = context->isWindowFocusAllowed(); 903 bool allowFocus = context->isWindowInteractionAllowed();
904 if (allowFocus) { 904 if (allowFocus) {
905 context->consumeWindowFocus(); 905 context->consumeWindowInteraction();
906 } else { 906 } else {
907 ASSERT(isMainThread()); 907 ASSERT(isMainThread());
908 allowFocus = opener() && (opener() != this) && (toDocument(context)->dom Window() == opener()); 908 allowFocus = opener() && (opener() != this) && (toDocument(context)->dom Window() == opener());
909 } 909 }
910 910
911 // If we're a top level window, bring the window to the front. 911 // If we're a top level window, bring the window to the front.
912 if (frame()->isMainFrame() && allowFocus) 912 if (frame()->isMainFrame() && allowFocus)
913 host->chrome().focus(); 913 host->chrome().focus();
914 914
915 frame()->eventHandler().focusDocumentView(); 915 frame()->eventHandler().focusDocumentView();
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 return m_frameObserver->frame(); 1835 return m_frameObserver->frame();
1836 } 1836 }
1837 1837
1838 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 1838 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
1839 { 1839 {
1840 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. 1840 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8].
1841 return v8::Handle<v8::Object>(); 1841 return v8::Handle<v8::Object>();
1842 } 1842 }
1843 1843
1844 } // namespace blink 1844 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/ScopedWindowFocusAllowedIndicator.h ('k') | Source/modules/serviceworkers/ServiceWorkerGlobalScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698