| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | 6 #define APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "content/public/browser/content_browser_client.h" | 9 #include "content/public/browser/content_browser_client.h" |
| 10 | 10 |
| 11 class GURL; | 11 class GURL; |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class BrowserContext; | 14 class BrowserContext; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 class Extension; | 18 class Extension; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace apps { | 21 namespace apps { |
| 22 class ShellDelegate; |
| 22 class ShellBrowserMainParts; | 23 class ShellBrowserMainParts; |
| 23 | 24 |
| 24 // Content module browser process support for app_shell. | 25 // Content module browser process support for app_shell. |
| 25 class ShellContentBrowserClient : public content::ContentBrowserClient { | 26 class ShellContentBrowserClient : public content::ContentBrowserClient { |
| 26 public: | 27 public: |
| 27 ShellContentBrowserClient(); | 28 explicit ShellContentBrowserClient(ShellDelegate* shell_delegate); |
| 28 virtual ~ShellContentBrowserClient(); | 29 virtual ~ShellContentBrowserClient(); |
| 29 | 30 |
| 30 // Returns the single instance. | 31 // Returns the single instance. |
| 31 static ShellContentBrowserClient* Get(); | 32 static ShellContentBrowserClient* Get(); |
| 32 | 33 |
| 33 // Returns the single browser context for app_shell. | 34 // Returns the single browser context for app_shell. |
| 34 content::BrowserContext* GetBrowserContext(); | 35 content::BrowserContext* GetBrowserContext(); |
| 35 | 36 |
| 36 // content::ContentBrowserClient overrides. | 37 // content::ContentBrowserClient overrides. |
| 37 virtual content::BrowserMainParts* CreateBrowserMainParts( | 38 virtual content::BrowserMainParts* CreateBrowserMainParts( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 std::vector<std::string>* additional_schemes) OVERRIDE; | 58 std::vector<std::string>* additional_schemes) OVERRIDE; |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 // Returns the extension or app associated with |site_instance| or NULL. | 61 // Returns the extension or app associated with |site_instance| or NULL. |
| 61 const extensions::Extension* GetExtension( | 62 const extensions::Extension* GetExtension( |
| 62 content::SiteInstance* site_instance); | 63 content::SiteInstance* site_instance); |
| 63 | 64 |
| 64 // Owned by content::BrowserMainLoop. | 65 // Owned by content::BrowserMainLoop. |
| 65 ShellBrowserMainParts* browser_main_parts_; | 66 ShellBrowserMainParts* browser_main_parts_; |
| 66 | 67 |
| 68 ShellDelegate* shell_delegate_; // now owned |
| 69 |
| 67 DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient); | 70 DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient); |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace apps | 73 } // namespace apps |
| 71 | 74 |
| 72 #endif // APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | 75 #endif // APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |