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

Side by Side Diff: content/public/browser/content_browser_client.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, 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 | 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_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // principal implementation. The methods are assumed to be called on the UI 84 // principal implementation. The methods are assumed to be called on the UI
85 // thread unless otherwise specified. Use this "escape hatch" sparingly, to 85 // thread unless otherwise specified. Use this "escape hatch" sparingly, to
86 // avoid the embedder interface ballooning and becoming very specific to Chrome. 86 // avoid the embedder interface ballooning and becoming very specific to Chrome.
87 // (Often, the call out to the client can happen in a different part of the code 87 // (Often, the call out to the client can happen in a different part of the code
88 // that either already has a hook out to the embedder, or calls out to one of 88 // that either already has a hook out to the embedder, or calls out to one of
89 // the observer interfaces.) 89 // the observer interfaces.)
90 class ContentBrowserClient { 90 class ContentBrowserClient {
91 public: 91 public:
92 virtual ~ContentBrowserClient() {} 92 virtual ~ContentBrowserClient() {}
93 93
94 enum CanCreateWindowResult {
jam 2012/03/28 02:38:26 nit: see hte other enums in content API to see the
Mihai Parparita -not on Chrome 2012/03/28 20:29:01 Went with the boolean out parameter approach.
95 // The given window canot be created.
Charlie Reis 2012/03/27 23:19:27 nit: cannot
Mihai Parparita -not on Chrome 2012/03/28 20:29:01 Obsolete, this enum is gone per John's comments.
96 CANNOT_CREATE_WINDOW,
97 // The given window can be created.
98 CAN_CREATE_WINDOW,
99 // The given window can be created, but it is not allowed to be scriptable,
100 // and should be put in a separate process.
101 CAN_CREATE_WINDOW_NO_JS_ACCESS
102 };
103
94 // Allows the embedder to set any number of custom BrowserMainParts 104 // Allows the embedder to set any number of custom BrowserMainParts
95 // implementations for the browser startup code. See comments in 105 // implementations for the browser startup code. See comments in
96 // browser_main_parts.h. 106 // browser_main_parts.h.
97 virtual BrowserMainParts* CreateBrowserMainParts( 107 virtual BrowserMainParts* CreateBrowserMainParts(
98 const content::MainFunctionParams& parameters) = 0; 108 const content::MainFunctionParams& parameters) = 0;
99 109
100 // Allows an embedder to return their own WebContentsView implementation. 110 // Allows an embedder to return their own WebContentsView implementation.
101 // Return NULL to let the default one for the platform be created. 111 // Return NULL to let the default one for the platform be created.
102 virtual WebContentsView* OverrideCreateWebContentsView( 112 virtual WebContentsView* OverrideCreateWebContentsView(
103 WebContents* web_contents) = 0; 113 WebContents* web_contents) = 0;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 int render_process_id, 333 int render_process_id,
324 int render_view_id, 334 int render_view_id,
325 bool worker) = 0; 335 bool worker) = 0;
326 336
327 // Cancels a displayed desktop notification. 337 // Cancels a displayed desktop notification.
328 virtual void CancelDesktopNotification( 338 virtual void CancelDesktopNotification(
329 int render_process_id, 339 int render_process_id,
330 int render_view_id, 340 int render_view_id,
331 int notification_id) = 0; 341 int notification_id) = 0;
332 342
333 // Returns true if the given page is allowed to open a window of the given 343 // Returns whether the given page is allowed to open a window of the given
334 // type. 344 // type.
335 // This is called on the IO thread. 345 // This is called on the IO thread.
336 virtual bool CanCreateWindow( 346 virtual CanCreateWindowResult CanCreateWindow(
337 const GURL& opener_url, 347 const GURL& opener_url,
338 const GURL& source_origin, 348 const GURL& source_origin,
339 WindowContainerType container_type, 349 WindowContainerType container_type,
340 content::ResourceContext* context, 350 content::ResourceContext* context,
341 int render_process_id) = 0; 351 int render_process_id) = 0;
342 352
343 // Returns a title string to use in the task manager for a process host with 353 // Returns a title string to use in the task manager for a process host with
344 // the given URL, or the empty string to fall back to the default logic. 354 // the given URL, or the empty string to fall back to the default logic.
345 // This is called on the IO thread. 355 // This is called on the IO thread.
346 virtual std::string GetWorkerProcessTitle( 356 virtual std::string GetWorkerProcessTitle(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 // This is called on a worker thread. 428 // This is called on a worker thread.
419 virtual 429 virtual
420 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( 430 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate(
421 const GURL& url) = 0; 431 const GURL& url) = 0;
422 #endif 432 #endif
423 }; 433 };
424 434
425 } // namespace content 435 } // namespace content
426 436
427 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 437 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698