| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ | 6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> |
| 10 |
| 9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/time.h" |
| 10 #include "content/browser/content_browser_client.h" | 13 #include "content/browser/content_browser_client.h" |
| 11 | 14 |
| 12 class QuotaPermissionContext; | 15 class QuotaPermissionContext; |
| 13 | 16 |
| 14 namespace chrome { | 17 namespace chrome { |
| 15 | 18 |
| 16 class ChromeContentBrowserClient : public content::ContentBrowserClient { | 19 class ChromeContentBrowserClient : public content::ContentBrowserClient { |
| 17 public: | 20 public: |
| 21 ChromeContentBrowserClient(); |
| 22 ~ChromeContentBrowserClient(); |
| 23 |
| 18 virtual void RenderViewHostCreated(RenderViewHost* render_view_host) OVERRIDE; | 24 virtual void RenderViewHostCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 19 virtual void BrowserRenderProcessHostCreated( | 25 virtual void BrowserRenderProcessHostCreated( |
| 20 BrowserRenderProcessHost* host) OVERRIDE; | 26 BrowserRenderProcessHost* host) OVERRIDE; |
| 21 virtual void PluginProcessHostCreated(PluginProcessHost* host) OVERRIDE; | 27 virtual void PluginProcessHostCreated(PluginProcessHost* host) OVERRIDE; |
| 22 virtual void WorkerProcessHostCreated(WorkerProcessHost* host) OVERRIDE; | 28 virtual void WorkerProcessHostCreated(WorkerProcessHost* host) OVERRIDE; |
| 23 virtual content::WebUIFactory* GetWebUIFactory() OVERRIDE; | 29 virtual content::WebUIFactory* GetWebUIFactory() OVERRIDE; |
| 24 virtual GURL GetEffectiveURL(Profile* profile, const GURL& url) OVERRIDE; | 30 virtual GURL GetEffectiveURL(Profile* profile, const GURL& url) OVERRIDE; |
| 25 virtual bool IsURLSameAsAnySiteInstance(const GURL& url) OVERRIDE; | 31 virtual bool IsURLSameAsAnySiteInstance(const GURL& url) OVERRIDE; |
| 26 virtual std::string GetCanonicalEncodingNameByAliasName( | 32 virtual std::string GetCanonicalEncodingNameByAliasName( |
| 27 const std::string& alias_name) OVERRIDE; | 33 const std::string& alias_name) OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 int render_view_id) OVERRIDE; | 45 int render_view_id) OVERRIDE; |
| 40 virtual bool AllowSetCookie(const GURL& url, | 46 virtual bool AllowSetCookie(const GURL& url, |
| 41 const GURL& first_party, | 47 const GURL& first_party, |
| 42 const std::string& cookie_line, | 48 const std::string& cookie_line, |
| 43 const content::ResourceContext& context, | 49 const content::ResourceContext& context, |
| 44 int render_process_id, | 50 int render_process_id, |
| 45 int render_view_id, | 51 int render_view_id, |
| 46 net::CookieOptions* options) OVERRIDE; | 52 net::CookieOptions* options) OVERRIDE; |
| 47 virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE; | 53 virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE; |
| 48 virtual void RevealFolderInOS(const FilePath& path) OVERRIDE; | 54 virtual void RevealFolderInOS(const FilePath& path) OVERRIDE; |
| 55 virtual void RunJavaScriptDialog(content::JavaScriptDialogDelegate* delegate, |
| 56 const GURL& frame_url, |
| 57 int dialog_flags, |
| 58 const string16& message_text, |
| 59 const string16& default_prompt_text, |
| 60 IPC::Message* reply_message, |
| 61 bool* did_suppress_message, |
| 62 Profile* profile) OVERRIDE; |
| 63 virtual void RunBeforeUnloadDialog( |
| 64 content::JavaScriptDialogDelegate* delegate, |
| 65 const string16& message_text, |
| 66 IPC::Message* reply_msg) OVERRIDE; |
| 67 virtual void ResetJavaScriptState( |
| 68 content::JavaScriptDialogDelegate* delegate) OVERRIDE; |
| 69 |
| 49 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 70 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 50 // Can return an optional fd for crash handling, otherwise returns -1. | 71 // Can return an optional fd for crash handling, otherwise returns -1. |
| 51 virtual int GetCrashSignalFD(const std::string& process_type) OVERRIDE; | 72 virtual int GetCrashSignalFD(const std::string& process_type) OVERRIDE; |
| 52 #endif | 73 #endif |
| 74 |
| 75 private: |
| 76 class JavaScriptDialogDelegateProxy; |
| 77 |
| 78 JavaScriptDialogDelegateProxy* ProxyForDelegate( |
| 79 content::JavaScriptDialogDelegate* delegate); |
| 80 |
| 81 // Mapping between the JavaScriptDialogDelegates and their proxies. The key is |
| 82 // a void* because the pointer is just a cookie and is never dereferenced. |
| 83 typedef std::map<void*, JavaScriptDialogDelegateProxy*> |
| 84 JavaScriptDialogProxyMap; |
| 85 JavaScriptDialogProxyMap javascript_dialog_proxies_; |
| 53 }; | 86 }; |
| 54 | 87 |
| 55 } // namespace chrome | 88 } // namespace chrome |
| 56 | 89 |
| 57 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ | 90 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |