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

Unified Diff: components/search/search.h

Issue 393173002: Moves some functions in search.h to components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gn Created 6 years, 5 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: components/search/search.h
diff --git a/components/search/search.h b/components/search/search.h
new file mode 100644
index 0000000000000000000000000000000000000000..86630a8bb673b99c4d5d446716200a2827b57012
--- /dev/null
+++ b/components/search/search.h
@@ -0,0 +1,59 @@
+// Copyright 2012 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 COMPONENTS_SEARCH_SEARCH_H_
+#define COMPONENTS_SEARCH_SEARCH_H_
+
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/strings/string16.h"
+
+namespace chrome {
blundell 2014/07/16 08:58:30 This should be in the "search" namespace now. I'm
Jun Mukai 2014/07/16 20:00:09 let me do that in another CL.
+
+// Returns whether the Instant Extended API is enabled.
+bool IsInstantExtendedAPIEnabled();
+
+// Returns the value to pass to the &espv CGI parameter when loading the
+// embedded search page from the user's default search provider. Returns 0 if
+// the Instant Extended API is not enabled.
+uint64 EmbeddedSearchPageVersion();
+
+// Type for a collection of experiment configuration parameters.
+typedef std::vector<std::pair<std::string, std::string> > FieldTrialFlags;
+
+// Finds the active field trial group name and parses out the configuration
+// flags. On success, |flags| will be filled with the field trial flags. |flags|
+// must not be NULL. Returns true iff the active field trial is successfully
+// parsed and not disabled.
+// Note that |flags| may be successfully populated in some cases when false is
+// returned - in these cases it should not be used.
+// Exposed for testing only.
+bool GetFieldTrialInfo(FieldTrialFlags* flags);
+
+// Given a FieldTrialFlags object, returns the string value of the provided
+// flag.
+// Exposed for testing only.
+std::string GetStringValueForFlagWithDefault(const std::string& flag,
+ const std::string& default_value,
+ const FieldTrialFlags& flags);
+
+// Given a FieldTrialFlags object, returns the uint64 value of the provided
+// flag.
+// Exposed for testing only.
+uint64 GetUInt64ValueForFlagWithDefault(const std::string& flag,
+ uint64 default_value,
+ const FieldTrialFlags& flags);
+
+// Given a FieldTrialFlags object, returns the bool value of the provided flag.
+// Exposed for testing only.
+bool GetBoolValueForFlagWithDefault(const std::string& flag,
+ bool default_value,
+ const FieldTrialFlags& flags);
+
+} // namespace chrome
+
+#endif // COMPONENTS_SEARCH_SEARCH_H_

Powered by Google App Engine
This is Rietveld 408576698