OLD | NEW |
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 Loading... |
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 { |
| 95 CANNOT_CREATE_WINDOW, |
| 96 CAN_CREATE_WINDOW, |
| 97 CAN_CREATE_WINDOW_NO_JS_ACCESS |
| 98 }; |
| 99 |
94 // Allows the embedder to set any number of custom BrowserMainParts | 100 // Allows the embedder to set any number of custom BrowserMainParts |
95 // implementations for the browser startup code. See comments in | 101 // implementations for the browser startup code. See comments in |
96 // browser_main_parts.h. | 102 // browser_main_parts.h. |
97 virtual BrowserMainParts* CreateBrowserMainParts( | 103 virtual BrowserMainParts* CreateBrowserMainParts( |
98 const content::MainFunctionParams& parameters) = 0; | 104 const content::MainFunctionParams& parameters) = 0; |
99 | 105 |
100 // Allows an embedder to return their own WebContentsView implementation. | 106 // Allows an embedder to return their own WebContentsView implementation. |
101 // Return NULL to let the default one for the platform be created. | 107 // Return NULL to let the default one for the platform be created. |
102 virtual WebContentsView* OverrideCreateWebContentsView( | 108 virtual WebContentsView* OverrideCreateWebContentsView( |
103 WebContents* web_contents) = 0; | 109 WebContents* web_contents) = 0; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 332 |
327 // Cancels a displayed desktop notification. | 333 // Cancels a displayed desktop notification. |
328 virtual void CancelDesktopNotification( | 334 virtual void CancelDesktopNotification( |
329 int render_process_id, | 335 int render_process_id, |
330 int render_view_id, | 336 int render_view_id, |
331 int notification_id) = 0; | 337 int notification_id) = 0; |
332 | 338 |
333 // Returns true if the given page is allowed to open a window of the given | 339 // Returns true if the given page is allowed to open a window of the given |
334 // type. | 340 // type. |
335 // This is called on the IO thread. | 341 // This is called on the IO thread. |
336 virtual bool CanCreateWindow( | 342 virtual CanCreateWindowResult CanCreateWindow( |
337 const GURL& opener_url, | 343 const GURL& opener_url, |
338 const GURL& source_origin, | 344 const GURL& source_origin, |
339 WindowContainerType container_type, | 345 WindowContainerType container_type, |
340 content::ResourceContext* context, | 346 content::ResourceContext* context, |
341 int render_process_id) = 0; | 347 int render_process_id) = 0; |
342 | 348 |
343 // Returns a title string to use in the task manager for a process host with | 349 // 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. | 350 // the given URL, or the empty string to fall back to the default logic. |
345 // This is called on the IO thread. | 351 // This is called on the IO thread. |
346 virtual std::string GetWorkerProcessTitle( | 352 virtual std::string GetWorkerProcessTitle( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // This is called on a worker thread. | 424 // This is called on a worker thread. |
419 virtual | 425 virtual |
420 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( | 426 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( |
421 const GURL& url) = 0; | 427 const GURL& url) = 0; |
422 #endif | 428 #endif |
423 }; | 429 }; |
424 | 430 |
425 } // namespace content | 431 } // namespace content |
426 | 432 |
427 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 433 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |