#ifndef CHROME_BROWSER_ABOUT_FLAGS_H_
#define CHROME_BROWSER_ABOUT_FLAGS_H_
+#include <stdint.h>
+
#include <map>
+#include <set>
#include <string>
#include "base/command_line.h"
+#include "base/metrics/histogram_base.h"
#include "base/strings/string16.h"
class PrefService;
class FlagsStorage;
+// This value is reported as switch histogram ID if switch name has unknown
+// format.
+extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId;
+
// Enumeration of OSs.
// This is exposed only for testing.
enum { kOsMac = 1 << 0, kOsWin = 1 << 1, kOsLinux = 1 << 2 , kOsCrOS = 1 << 3,
// Compares a set of switches of the two provided command line objects and
// returns true if they are the same and false otherwise.
+// If |out_difference| is not NULL, it's filled with set_symmetric_difference
+// between sets.
bool AreSwitchesIdenticalToCurrentCommandLine(
const base::CommandLine& new_cmdline,
- const base::CommandLine& active_cmdline);
+ const base::CommandLine& active_cmdline,
+ std::set<CommandLine::StringType>* out_difference);
// Differentiate between generic flags available on a per session base and flags
// that influence the whole machine and can be said by the admin only. This flag
// startup.
void RecordUMAStatistics(FlagsStorage* flags_storage);
+// Returns the UMA id for the specified switch name.
+base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name);
+
+// Sends stats (as UMA histogram) about command_line_difference.
+// This is used on ChromeOS to report flags that lead to browser restart.
+// |command_line_difference| is the result of
+// AreSwitchesIdenticalToCurrentCommandLine().
+void ReportCustomFlags(const std::string& uma_histogram_hame,
+ const std::set<std::string>& command_line_difference);
+
namespace testing {
// Clears internal global state, for unit tests.