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

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 12084029: Simplify how TestChromeWebUIControllerFactory is registered now that multiple WebUIControllerFactor… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix MostVisitedWebUITest tests 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
Index: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
===================================================================
--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (revision 179158)
+++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (working copy)
@@ -48,7 +48,6 @@
#include "chrome/browser/ui/webui/quota_internals_ui.h"
#include "chrome/browser/ui/webui/signin_internals_ui.h"
#include "chrome/browser/ui/webui/sync_internals_ui.h"
-#include "chrome/browser/ui/webui/test_chrome_web_ui_controller_factory.h"
#include "chrome/browser/ui/webui/tracing_ui.h"
#include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
#include "chrome/browser/ui/webui/version_ui.h"
@@ -120,8 +119,6 @@
namespace {
-static bool g_use_test_factory = false;
-
// A function for creating a new WebUI. The caller owns the return value, which
// may be NULL (for example, if the URL refers to an non-existent extension).
typedef WebUIController* (*WebUIFactoryFunction)(WebUI* web_ui,
@@ -410,20 +407,6 @@
return NULL;
}
-// When the test-type switch is set, return a TestType object, which should be a
-// subclass of Type. The logic is provided here in the traits class, rather than
-// in GetInstance() so that the choice is made only once, when the Singleton is
-// first instantiated, rather than every time GetInstance() is called.
-template<typename Type, typename TestType>
-struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> {
- static Type* New() {
- if (g_use_test_factory)
- return DefaultSingletonTraits<TestType>::New();
- else
- return DefaultSingletonTraits<Type>::New();
- }
-};
-
void RunFaviconCallbackAsync(
const FaviconService::FaviconResultsCallback& callback,
const std::vector<history::FaviconBitmapResult>* results) {
@@ -542,15 +525,9 @@
// static
ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() {
- return Singleton< ChromeWebUIControllerFactory, PossibleTestSingletonTraits<
- ChromeWebUIControllerFactory, TestChromeWebUIControllerFactory> >::get();
+ return Singleton<ChromeWebUIControllerFactory>::get();
}
-// static
-void ChromeWebUIControllerFactory::UseTestFactoryForTesting() {
- g_use_test_factory = true;
-}
-
ChromeWebUIControllerFactory::ChromeWebUIControllerFactory() {
}

Powered by Google App Engine
This is Rietveld 408576698