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

Unified Diff: chrome/browser/ui/search/search.cc

Issue 11428149: Alternate NTP: Move bookmark bar to bottom (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add tests Created 8 years 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/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

Powered by Google App Engine
This is Rietveld 408576698