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

Side by Side Diff: Source/core/dom/ExecutionContext.h

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
« no previous file with comments | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 int circularSequentialID(); 123 int circularSequentialID();
124 124
125 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); 125 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier();
126 126
127 virtual EventTarget* errorEventTarget() = 0; 127 virtual EventTarget* errorEventTarget() = 0;
128 virtual EventQueue* eventQueue() const = 0; 128 virtual EventQueue* eventQueue() const = 0;
129 129
130 void enforceStrictMixedContentChecking() { m_strictMixedContentCheckingEnfor ced = true; } 130 void enforceStrictMixedContentChecking() { m_strictMixedContentCheckingEnfor ced = true; }
131 bool shouldEnforceStrictMixedContentChecking() const { return m_strictMixedC ontentCheckingEnforced; } 131 bool shouldEnforceStrictMixedContentChecking() const { return m_strictMixedC ontentCheckingEnforced; }
132 132
133 void allowWindowFocus(); 133 // Methods related to window interaction. It should be used to manage window
134 void consumeWindowFocus(); 134 // focusing and window creation permission for an ExecutionContext.
135 bool isWindowFocusAllowed() const; 135 void allowWindowInteraction();
136 void consumeWindowInteraction();
137 bool isWindowInteractionAllowed() const;
136 138
137 protected: 139 protected:
138 ExecutionContext(); 140 ExecutionContext();
139 virtual ~ExecutionContext(); 141 virtual ~ExecutionContext();
140 142
141 virtual const KURL& virtualURL() const = 0; 143 virtual const KURL& virtualURL() const = 0;
142 virtual KURL virtualCompleteURL(const String&) const = 0; 144 virtual KURL virtualCompleteURL(const String&) const = 0;
143 145
144 ContextLifecycleNotifier& lifecycleNotifier(); 146 ContextLifecycleNotifier& lifecycleNotifier();
145 147
(...skipping 14 matching lines...) Expand all
160 162
161 bool m_activeDOMObjectsAreSuspended; 163 bool m_activeDOMObjectsAreSuspended;
162 bool m_activeDOMObjectsAreStopped; 164 bool m_activeDOMObjectsAreStopped;
163 165
164 OwnPtrWillBeMember<PublicURLManager> m_publicURLManager; 166 OwnPtrWillBeMember<PublicURLManager> m_publicURLManager;
165 167
166 bool m_strictMixedContentCheckingEnforced; 168 bool m_strictMixedContentCheckingEnforced;
167 169
168 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; 170 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier;
169 171
170 // Counter that keeps track of how many window focus calls are allowed for 172 // Counter that keeps track of how many window interaction calls are allowed
171 // this ExecutionContext. Callers are expected to call |allowWindowFocus()| 173 // for this ExecutionContext. Callers are expected to call
172 // and |consumeWindowFocus()| in order to increment and decrement the 174 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to
173 // counter. 175 // increment and decrement the counter.
174 int m_windowFocusTokens; 176 int m_windowInteractionTokens;
175 }; 177 };
176 178
177 } // namespace blink 179 } // namespace blink
178 180
179 #endif // ExecutionContext_h 181 #endif // ExecutionContext_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698