Index: chrome/browser/ui/search/search.cc |
diff --git a/chrome/browser/ui/search/search.cc b/chrome/browser/ui/search/search.cc |
index 5a700e4bb374ed6540425f9676972088d5425ebe..d06050ec431d7390643a6017891fcc6ca533b9ac 100644 |
--- a/chrome/browser/ui/search/search.cc |
+++ b/chrome/browser/ui/search/search.cc |
@@ -9,15 +9,28 @@ |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/chrome_version_info.h" |
+namespace { |
+ |
+static bool s_is_instant_extended_api_enabled_for_testing = false; |
dhollowa
2012/12/04 01:24:49
Let's not do this.
Prefer to add:
CommandLine*
sail
2012/12/04 01:41:12
Unfotunately that's not enough since the function
dhollowa
2012/12/04 01:56:16
If you sync, you'll find that it is enough now. I
sail
2012/12/04 04:26:30
Done.
I had one big oversight in my previous code
dhollowa
2012/12/04 05:17:53
Gosh yes, that is pretty ugly. Not to rat-hole he
sail
2012/12/04 18:00:07
Done.
Good idea!
|
+ |
+} |
+ |
namespace chrome { |
namespace search { |
bool IsInstantExtendedAPIEnabled(const Profile* profile) { |
+ if (s_is_instant_extended_api_enabled_for_testing) |
+ return true; |
+ |
return VersionInfo::GetChannel() <= VersionInfo::CHANNEL_DEV && |
!profile->IsOffTheRecord() && |
CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kEnableInstantExtendedAPI); |
} |
+void EnableInstantExtendedAPIForTesting() { |
+ s_is_instant_extended_api_enabled_for_testing = true; |
+} |
+ |
} // namespace search |
} // namespace chrome |