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_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ | 5 #ifndef CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ |
6 #define CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ | 6 #define CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
| 12 #include "base/macros.h" |
12 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 13 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
13 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
14 | 15 |
15 // This class replaces the ChromeWebUIFactory when the switches::kTestType flag | 16 // This class replaces the ChromeWebUIFactory when the switches::kTestType flag |
16 // is passed. It provides a registry to override CreateWebUIControllerForURL() | 17 // is passed. It provides a registry to override CreateWebUIControllerForURL() |
17 // by host. | 18 // by host. |
18 class TestChromeWebUIControllerFactory : public ChromeWebUIControllerFactory { | 19 class TestChromeWebUIControllerFactory : public ChromeWebUIControllerFactory { |
19 public: | 20 public: |
20 // Interface to create a new WebUI object. | 21 // Interface to create a new WebUI object. |
21 class WebUIProvider { | 22 class WebUIProvider { |
(...skipping 29 matching lines...) Expand all Loading... |
51 // Return the WebUIProvider for the |url|'s host if it exists, otherwise NULL. | 52 // Return the WebUIProvider for the |url|'s host if it exists, otherwise NULL. |
52 WebUIProvider* GetWebUIProvider(Profile* profile, const GURL& url) const; | 53 WebUIProvider* GetWebUIProvider(Profile* profile, const GURL& url) const; |
53 | 54 |
54 // Stores the mapping of host to WebUIProvider. | 55 // Stores the mapping of host to WebUIProvider. |
55 FactoryOverridesMap factory_overrides_; | 56 FactoryOverridesMap factory_overrides_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(TestChromeWebUIControllerFactory); | 58 DISALLOW_COPY_AND_ASSIGN(TestChromeWebUIControllerFactory); |
58 }; | 59 }; |
59 | 60 |
60 #endif // CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ | 61 #endif // CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_ |
OLD | NEW |