Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: chrome/test/base/test_chrome_web_ui_controller_factory.h

Issue 12089051: Revert 179271 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/js2gtest.js ('k') | chrome/test/base/test_chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/test_chrome_web_ui_controller_factory.h
===================================================================
--- chrome/test/base/test_chrome_web_ui_controller_factory.h (revision 179344)
+++ chrome/test/base/test_chrome_web_ui_controller_factory.h (working copy)
@@ -1,60 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_
-#define CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_
-
-#include <functional>
-#include <map>
-#include <string>
-
-#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
-#include "content/public/browser/web_ui.h"
-
-// This class replaces the ChromeWebUIFactory when the switches::kTestType flag
-// is passed. It provides a registry to override CreateWebUIControllerForURL()
-// by host.
-class TestChromeWebUIControllerFactory : public ChromeWebUIControllerFactory {
- public:
- // Interface to create a new WebUI object.
- class WebUIProvider {
- public:
- // Create and return a new WebUI object for the |web_contents| based on the
- // |url|.
- virtual content::WebUIController* NewWebUI(content::WebUI* web_ui,
- const GURL& url) = 0;
-
- protected:
- virtual ~WebUIProvider();
- };
-
- typedef std::map<std::string, WebUIProvider*> FactoryOverridesMap;
-
- TestChromeWebUIControllerFactory();
- virtual ~TestChromeWebUIControllerFactory();
-
- // Override the creation for urls having |host| with |provider|.
- void AddFactoryOverride(const std::string& host, WebUIProvider* provider);
-
- // Remove the override for urls having |host|.
- void RemoveFactoryOverride(const std::string& host);
-
- // ChromeWebUIFactory overrides.
- virtual content::WebUI::TypeID GetWebUIType(
- content::BrowserContext* browser_context,
- const GURL& url) const OVERRIDE;
- virtual content::WebUIController* CreateWebUIControllerForURL(
- content::WebUI* web_ui, const GURL& url) const OVERRIDE;
-
- private:
- // Return the WebUIProvider for the |url|'s host if it exists, otherwise NULL.
- WebUIProvider* GetWebUIProvider(Profile* profile, const GURL& url) const;
-
- // Stores the mapping of host to WebUIProvider.
- FactoryOverridesMap factory_overrides_;
-
- DISALLOW_COPY_AND_ASSIGN(TestChromeWebUIControllerFactory);
-};
-
-#endif // CHROME_TEST_BASE_TEST_CHROME_WEB_UI_CONTROLLER_FACTORY_H_
« no previous file with comments | « chrome/test/base/js2gtest.js ('k') | chrome/test/base/test_chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698