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

Side by Side Diff: content/public/browser/web_contents_delegate.h

Issue 9837074: Make it so that allow_js_access: false can be used with background pages created by window.open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revised approach based on http://crrev.com/125180. Created 8 years, 9 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 | Annotate | Revision Log
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 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // Returns whether this tab contents should add the specified navigation to 266 // Returns whether this tab contents should add the specified navigation to
267 // history. 267 // history.
268 virtual bool ShouldAddNavigationToHistory( 268 virtual bool ShouldAddNavigationToHistory(
269 const history::HistoryAddPageArgs& add_page_args, 269 const history::HistoryAddPageArgs& add_page_args,
270 NavigationType navigation_type); 270 NavigationType navigation_type);
271 271
272 // Returns the native window framing the view containing the tab contents. 272 // Returns the native window framing the view containing the tab contents.
273 virtual gfx::NativeWindow GetFrameNativeWindow(); 273 virtual gfx::NativeWindow GetFrameNativeWindow();
274 274
275 // Allows delegate to control whether a WebContents will be created. Returns 275 // Allows delegate to control whether a WebContents will be created. Returns
276 // true to allow the creation. Default is to allow it. 276 // true to allow the creation. Default is to allow it.
Charlie Reis 2012/03/27 23:19:27 Should we mention that |target_url| isn't normally
Mihai Parparita -not on Chrome 2012/03/28 20:29:01 In theory, a delegate could also make decisions ba
277 virtual bool ShouldCreateWebContents( 277 virtual bool ShouldCreateWebContents(
278 WebContents* web_contents, 278 WebContents* web_contents,
279 int route_id, 279 int route_id,
280 WindowContainerType window_container_type, 280 WindowContainerType window_container_type,
281 const string16& frame_name); 281 const string16& frame_name,
282 const GURL& target_url);
282 283
283 // Notifies the delegate about the creation of a new WebContents. This 284 // Notifies the delegate about the creation of a new WebContents. This
284 // typically happens when popups are created. 285 // typically happens when popups are created.
285 virtual void WebContentsCreated(WebContents* source_contents, 286 virtual void WebContentsCreated(WebContents* source_contents,
286 int64 source_frame_id, 287 int64 source_frame_id,
287 const GURL& target_url, 288 const GURL& target_url,
288 WebContents* new_contents) {} 289 WebContents* new_contents) {}
289 290
290 // Notifies the delegate that the content restrictions for this tab has 291 // Notifies the delegate that the content restrictions for this tab has
291 // changed. 292 // changed.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // Called when |this| is no longer the WebContentsDelegate for |source|. 405 // Called when |this| is no longer the WebContentsDelegate for |source|.
405 void Detach(WebContents* source); 406 void Detach(WebContents* source);
406 407
407 // The WebContents that this is currently a delegate for. 408 // The WebContents that this is currently a delegate for.
408 std::set<WebContents*> attached_contents_; 409 std::set<WebContents*> attached_contents_;
409 }; 410 };
410 411
411 } // namespace content 412 } // namespace content
412 413
413 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 414 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698