| 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_FACTORY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_FACTORY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 class Browser; | 10 class Browser; |
| 11 class GURL; | 11 class GURL; |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class ExtensionViewHost; | 16 class ExtensionViewHost; |
| 17 | 17 |
| 18 // A utility class to make ExtensionViewHosts for UI views that are backed | 18 // A utility class to make ExtensionViewHosts for UI views that are backed |
| 19 // by extensions. | 19 // by extensions. |
| 20 class ExtensionViewHostFactory { | 20 class ExtensionViewHostFactory { |
| 21 public: | 21 public: |
| 22 // Creates a new ExtensionHost with its associated view, grouping it in the | 22 // Creates a new ExtensionHost with its associated view, grouping it in the |
| 23 // appropriate SiteInstance (and therefore process) based on the URL and | 23 // appropriate SiteInstance (and therefore process) based on the URL and |
| 24 // profile. | 24 // profile. |
| 25 static ExtensionViewHost* CreatePopupHost(const GURL& url, Browser* browser); | 25 static ExtensionViewHost* CreatePopupHost(const GURL& url, Browser* browser); |
| 26 static ExtensionViewHost* CreateInfobarHost(const GURL& url, | |
| 27 Browser* browser); | |
| 28 | 26 |
| 29 // Some dialogs may not be associated with a particular browser window and | 27 // Some dialogs may not be associated with a particular browser window and |
| 30 // hence only require a |profile|. | 28 // hence only require a |profile|. |
| 31 static ExtensionViewHost* CreateDialogHost(const GURL& url, Profile* profile); | 29 static ExtensionViewHost* CreateDialogHost(const GURL& url, Profile* profile); |
| 32 | 30 |
| 33 private: | 31 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(ExtensionViewHostFactory); | 32 DISALLOW_COPY_AND_ASSIGN(ExtensionViewHostFactory); |
| 35 }; | 33 }; |
| 36 | 34 |
| 37 } // namespace extensions | 35 } // namespace extensions |
| 38 | 36 |
| 39 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_FACTORY_H_ | 37 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_FACTORY_H_ |
| OLD | NEW |