metrics: Fix import paths for headers.

This CL fixes the import path to match the Android format.
The libmetrics headers were also moved to include/metrics to make
exporting headers cleaner.

BUG: 22879597

Change-Id: I67d1ac1746cc3560ae4cbddecf97fa48c9dd1480
diff --git a/metrics/c_metrics_library.h b/metrics/include/metrics/c_metrics_library.h
similarity index 100%
rename from metrics/c_metrics_library.h
rename to metrics/include/metrics/c_metrics_library.h
diff --git a/metrics/metrics_library.h b/metrics/include/metrics/metrics_library.h
similarity index 100%
rename from metrics/metrics_library.h
rename to metrics/include/metrics/metrics_library.h
diff --git a/metrics/metrics_daemon.cc b/metrics/metrics_daemon.cc
index 880e90c..39af67b 100644
--- a/metrics/metrics_daemon.cc
+++ b/metrics/metrics_daemon.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/metrics_daemon.h"
+#include "metrics_daemon.h"
 
 #include <fcntl.h>
 #include <inttypes.h>
@@ -11,6 +11,7 @@
 #include <sysexits.h>
 #include <time.h>
 
+#include <base/bind.h>
 #include <base/files/file_path.h>
 #include <base/files/file_util.h>
 #include <base/hash.h>
@@ -20,7 +21,6 @@
 #include <base/strings/string_util.h>
 #include <base/strings/stringprintf.h>
 #include <base/sys_info.h>
-#include <chromeos/dbus/service_constants.h>
 #include <dbus/dbus.h>
 #include <dbus/message.h>
 #include "uploader/upload_service.h"
diff --git a/metrics/metrics_daemon.h b/metrics/metrics_daemon.h
index b1b2d11..04c40e5 100644
--- a/metrics/metrics_daemon.h
+++ b/metrics/metrics_daemon.h
@@ -18,7 +18,7 @@
 #include <gtest/gtest_prod.h>  // for FRIEND_TEST
 
 #include "metrics/metrics_library.h"
-#include "metrics/persistent_integer.h"
+#include "persistent_integer.h"
 #include "uploader/upload_service.h"
 
 using chromeos_metrics::PersistentInteger;
diff --git a/metrics/metrics_daemon_main.cc b/metrics/metrics_daemon_main.cc
index 1f64ef3..4a603e4 100644
--- a/metrics/metrics_daemon_main.cc
+++ b/metrics/metrics_daemon_main.cc
@@ -10,7 +10,7 @@
 #include <chromeos/syslog_logging.h>
 #include <rootdev/rootdev.h>
 
-#include "metrics/metrics_daemon.h"
+#include "metrics_daemon.h"
 
 const char kScalingMaxFreqPath[] =
     "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq";
diff --git a/metrics/metrics_daemon_test.cc b/metrics/metrics_daemon_test.cc
index 7dafbd6..fa9fcfa 100644
--- a/metrics/metrics_daemon_test.cc
+++ b/metrics/metrics_daemon_test.cc
@@ -15,9 +15,9 @@
 #include <chromeos/dbus/service_constants.h>
 #include <gtest/gtest.h>
 
-#include "metrics/metrics_daemon.h"
-#include "metrics/metrics_library_mock.h"
-#include "metrics/persistent_integer_mock.h"
+#include "metrics_daemon.h"
+#include "metrics_library_mock.h"
+#include "persistent_integer_mock.h"
 
 using base::FilePath;
 using base::StringPrintf;
diff --git a/metrics/metrics_library.cc b/metrics/metrics_library.cc
index 70c8eac..437787a 100644
--- a/metrics/metrics_library.cc
+++ b/metrics/metrics_library.cc
@@ -13,8 +13,8 @@
 #include <cstdio>
 #include <cstring>
 
-#include "metrics/serialization/metric_sample.h"
-#include "metrics/serialization/serialization_utils.h"
+#include "serialization/metric_sample.h"
+#include "serialization/serialization_utils.h"
 
 #include "policy/device_policy.h"
 
diff --git a/metrics/persistent_integer.cc b/metrics/persistent_integer.cc
index dd38f1e..c6b2176 100644
--- a/metrics/persistent_integer.cc
+++ b/metrics/persistent_integer.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/persistent_integer.h"
+#include "persistent_integer.h"
 
 #include <fcntl.h>
 
diff --git a/metrics/persistent_integer_mock.h b/metrics/persistent_integer_mock.h
index 2061e55..31bfc35 100644
--- a/metrics/persistent_integer_mock.h
+++ b/metrics/persistent_integer_mock.h
@@ -9,7 +9,7 @@
 
 #include <gmock/gmock.h>
 
-#include "metrics/persistent_integer.h"
+#include "persistent_integer.h"
 
 namespace chromeos_metrics {
 
diff --git a/metrics/persistent_integer_test.cc b/metrics/persistent_integer_test.cc
index a56aede..4fccb72 100644
--- a/metrics/persistent_integer_test.cc
+++ b/metrics/persistent_integer_test.cc
@@ -8,7 +8,7 @@
 #include <base/files/file_enumerator.h>
 #include <base/files/file_util.h>
 
-#include "metrics/persistent_integer.h"
+#include "persistent_integer.h"
 
 const char kBackingFileName[] = "1.pibakf";
 const char kBackingFilePattern[] = "*.pibakf";
diff --git a/metrics/serialization/metric_sample.cc b/metrics/serialization/metric_sample.cc
index 5447497..bc6583d 100644
--- a/metrics/serialization/metric_sample.cc
+++ b/metrics/serialization/metric_sample.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/serialization/metric_sample.h"
+#include "serialization/metric_sample.h"
 
 #include <string>
 #include <vector>
diff --git a/metrics/serialization/serialization_utils.cc b/metrics/serialization/serialization_utils.cc
index 9aa076a..d18dcd7 100644
--- a/metrics/serialization/serialization_utils.cc
+++ b/metrics/serialization/serialization_utils.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/serialization/serialization_utils.h"
+#include "serialization/serialization_utils.h"
 
 #include <sys/file.h>
 
@@ -17,7 +17,7 @@
 #include "base/memory/scoped_vector.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
-#include "metrics/serialization/metric_sample.h"
+#include "serialization/metric_sample.h"
 
 #define READ_WRITE_ALL_FILE_FLAGS \
   (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
diff --git a/metrics/serialization/serialization_utils_unittest.cc b/metrics/serialization/serialization_utils_unittest.cc
index 34d76cf..fb802bc 100644
--- a/metrics/serialization/serialization_utils_unittest.cc
+++ b/metrics/serialization/serialization_utils_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/serialization/serialization_utils.h"
+#include "serialization/serialization_utils.h"
 
 #include <base/files/file_util.h>
 #include <base/files/scoped_temp_dir.h>
@@ -10,7 +10,7 @@
 #include <base/strings/stringprintf.h>
 #include <gtest/gtest.h>
 
-#include "metrics/serialization/metric_sample.h"
+#include "serialization/metric_sample.h"
 
 namespace metrics {
 namespace {
diff --git a/metrics/timer.cc b/metrics/timer.cc
index 99f68fe..ce4bf67 100644
--- a/metrics/timer.cc
+++ b/metrics/timer.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/timer.h"
+#include "timer.h"
 
 #include <string>
 
diff --git a/metrics/timer_mock.h b/metrics/timer_mock.h
index 2f2d0f4..ed76f12 100644
--- a/metrics/timer_mock.h
+++ b/metrics/timer_mock.h
@@ -9,7 +9,7 @@
 
 #include <gmock/gmock.h>
 
-#include "metrics/timer.h"
+#include "timer.h"
 
 namespace chromeos_metrics {
 
diff --git a/metrics/timer_test.cc b/metrics/timer_test.cc
index ec6c6bd..b1689bf 100644
--- a/metrics/timer_test.cc
+++ b/metrics/timer_test.cc
@@ -8,9 +8,9 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "metrics/metrics_library_mock.h"
-#include "metrics/timer.h"
-#include "metrics/timer_mock.h"
+#include "metrics_library_mock.h"
+#include "timer.h"
+#include "timer_mock.h"
 
 using ::testing::_;
 using ::testing::Return;
diff --git a/metrics/uploader/metrics_hashes.cc b/metrics/uploader/metrics_hashes.cc
index 87405a3..f9d0cfe 100644
--- a/metrics/uploader/metrics_hashes.cc
+++ b/metrics/uploader/metrics_hashes.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/metrics_hashes.h"
+#include "uploader/metrics_hashes.h"
 
 #include "base/logging.h"
 #include "base/md5.h"
diff --git a/metrics/uploader/metrics_hashes_unittest.cc b/metrics/uploader/metrics_hashes_unittest.cc
index f7e390f..8cdc7a9 100644
--- a/metrics/uploader/metrics_hashes_unittest.cc
+++ b/metrics/uploader/metrics_hashes_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/metrics_hashes.h"
+#include "uploader/metrics_hashes.h"
 
 #include <base/format_macros.h>
 #include <base/macros.h>
diff --git a/metrics/uploader/metrics_log.cc b/metrics/uploader/metrics_log.cc
index 4d493b8..6f11f8a 100644
--- a/metrics/uploader/metrics_log.cc
+++ b/metrics/uploader/metrics_log.cc
@@ -6,7 +6,7 @@
 
 #include <string>
 
-#include "metrics/uploader/proto/system_profile.pb.h"
+#include "uploader/proto/system_profile.pb.h"
 #include "uploader/system_profile_setter.h"
 
 // We use default values for the MetricsLogBase constructor as the setter will
diff --git a/metrics/uploader/metrics_log.h b/metrics/uploader/metrics_log.h
index 5796325..a62798f 100644
--- a/metrics/uploader/metrics_log.h
+++ b/metrics/uploader/metrics_log.h
@@ -9,7 +9,7 @@
 
 #include <base/macros.h>
 
-#include "metrics/uploader/metrics_log_base.h"
+#include "uploader/metrics_log_base.h"
 
 // This file defines a set of user experience metrics data recorded by
 // the MetricsService. This is the unit of data that is sent to the server.
diff --git a/metrics/uploader/metrics_log_base.cc b/metrics/uploader/metrics_log_base.cc
index 7fe1ae1..3ae01e8 100644
--- a/metrics/uploader/metrics_log_base.cc
+++ b/metrics/uploader/metrics_log_base.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/metrics_log_base.h"
+#include "uploader/metrics_log_base.h"
 
 #include "base/metrics/histogram_base.h"
 #include "base/metrics/histogram_samples.h"
-#include "metrics/uploader/metrics_hashes.h"
-#include "metrics/uploader/proto/histogram_event.pb.h"
-#include "metrics/uploader/proto/system_profile.pb.h"
-#include "metrics/uploader/proto/user_action_event.pb.h"
+#include "uploader/metrics_hashes.h"
+#include "uploader/proto/histogram_event.pb.h"
+#include "uploader/proto/system_profile.pb.h"
+#include "uploader/proto/user_action_event.pb.h"
 
 using base::Histogram;
 using base::HistogramBase;
diff --git a/metrics/uploader/metrics_log_base.h b/metrics/uploader/metrics_log_base.h
index e871c0f..4173335 100644
--- a/metrics/uploader/metrics_log_base.h
+++ b/metrics/uploader/metrics_log_base.h
@@ -13,7 +13,7 @@
 #include "base/macros.h"
 #include "base/metrics/histogram.h"
 #include "base/time/time.h"
-#include "metrics/uploader/proto/chrome_user_metrics_extension.pb.h"
+#include "uploader/proto/chrome_user_metrics_extension.pb.h"
 
 namespace base {
 class HistogramSamples;
diff --git a/metrics/uploader/metrics_log_base_unittest.cc b/metrics/uploader/metrics_log_base_unittest.cc
index 5da428a..dc03f00 100644
--- a/metrics/uploader/metrics_log_base_unittest.cc
+++ b/metrics/uploader/metrics_log_base_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/metrics_log_base.h"
+#include "uploader/metrics_log_base.h"
 
 #include <string>
 
@@ -10,7 +10,7 @@
 #include <base/metrics/sample_vector.h>
 #include <gtest/gtest.h>
 
-#include "metrics/uploader/proto/chrome_user_metrics_extension.pb.h"
+#include "uploader/proto/chrome_user_metrics_extension.pb.h"
 
 namespace metrics {
 
diff --git a/metrics/uploader/mock/sender_mock.h b/metrics/uploader/mock/sender_mock.h
index 159b645..0a15d61 100644
--- a/metrics/uploader/mock/sender_mock.h
+++ b/metrics/uploader/mock/sender_mock.h
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "base/compiler_specific.h"
-#include "metrics/uploader/proto/chrome_user_metrics_extension.pb.h"
+#include "uploader/proto/chrome_user_metrics_extension.pb.h"
 #include "uploader/sender.h"
 
 class SenderMock : public Sender {
diff --git a/metrics/uploader/proto/chrome_user_metrics_extension.proto b/metrics/uploader/proto/chrome_user_metrics_extension.proto
index f712fc9..2c91f9f 100644
--- a/metrics/uploader/proto/chrome_user_metrics_extension.proto
+++ b/metrics/uploader/proto/chrome_user_metrics_extension.proto
@@ -14,9 +14,9 @@
 
 package metrics;
 
-import "histogram_event.proto";
-import "system_profile.proto";
-import "user_action_event.proto";
+import "system/core/metrics/uploader/proto/histogram_event.proto";
+import "system/core/metrics/uploader/proto/system_profile.proto";
+import "system/core/metrics/uploader/proto/user_action_event.proto";
 
 // Next tag: 13
 message ChromeUserMetricsExtension {
diff --git a/metrics/uploader/sender_http.cc b/metrics/uploader/sender_http.cc
index 8488b66..a740310 100644
--- a/metrics/uploader/sender_http.cc
+++ b/metrics/uploader/sender_http.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/sender_http.h"
+#include "uploader/sender_http.h"
 
 #include <string>
 
diff --git a/metrics/uploader/sender_http.h b/metrics/uploader/sender_http.h
index 4880b28..380cad8 100644
--- a/metrics/uploader/sender_http.h
+++ b/metrics/uploader/sender_http.h
@@ -9,7 +9,7 @@
 
 #include <base/macros.h>
 
-#include "metrics/uploader/sender.h"
+#include "uploader/sender.h"
 
 // Sender implemented using http_utils from libchromeos
 class HttpSender : public Sender {
diff --git a/metrics/uploader/system_profile_cache.cc b/metrics/uploader/system_profile_cache.cc
index ea4a38c..00def44 100644
--- a/metrics/uploader/system_profile_cache.cc
+++ b/metrics/uploader/system_profile_cache.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/system_profile_cache.h"
+#include "uploader/system_profile_cache.h"
 
 #include <string>
 #include <vector>
@@ -13,9 +13,9 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/sys_info.h"
-#include "metrics/persistent_integer.h"
-#include "metrics/uploader/metrics_log_base.h"
-#include "metrics/uploader/proto/chrome_user_metrics_extension.pb.h"
+#include "persistent_integer.h"
+#include "uploader/metrics_log_base.h"
+#include "uploader/proto/chrome_user_metrics_extension.pb.h"
 #include "vboot/crossystem.h"
 
 namespace {
diff --git a/metrics/uploader/system_profile_cache.h b/metrics/uploader/system_profile_cache.h
index e7a7337..4a492c2 100644
--- a/metrics/uploader/system_profile_cache.h
+++ b/metrics/uploader/system_profile_cache.h
@@ -12,10 +12,9 @@
 #include "base/compiler_specific.h"
 #include "base/gtest_prod_util.h"
 #include "base/memory/scoped_ptr.h"
-#include "chromeos/osrelease_reader.h"
-#include "metrics/persistent_integer.h"
-#include "metrics/uploader/proto/system_profile.pb.h"
-#include "metrics/uploader/system_profile_setter.h"
+#include "persistent_integer.h"
+#include "uploader/proto/system_profile.pb.h"
+#include "uploader/system_profile_setter.h"
 
 namespace metrics {
 class ChromeUserMetricsExtension;
diff --git a/metrics/uploader/upload_service.cc b/metrics/uploader/upload_service.cc
index 92c9e10..f24b0a8 100644
--- a/metrics/uploader/upload_service.cc
+++ b/metrics/uploader/upload_service.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "metrics/uploader/upload_service.h"
+#include "uploader/upload_service.h"
 
 #include <string>
 
@@ -17,11 +17,11 @@
 #include <base/metrics/statistics_recorder.h>
 #include <base/sha1.h>
 
-#include "metrics/serialization/metric_sample.h"
-#include "metrics/serialization/serialization_utils.h"
-#include "metrics/uploader/metrics_log.h"
-#include "metrics/uploader/sender_http.h"
-#include "metrics/uploader/system_profile_cache.h"
+#include "serialization/metric_sample.h"
+#include "serialization/serialization_utils.h"
+#include "uploader/metrics_log.h"
+#include "uploader/sender_http.h"
+#include "uploader/system_profile_cache.h"
 
 const int UploadService::kMaxFailedUpload = 10;
 
diff --git a/metrics/uploader/upload_service.h b/metrics/uploader/upload_service.h
index ebbb54f..c08fc1a 100644
--- a/metrics/uploader/upload_service.h
+++ b/metrics/uploader/upload_service.h
@@ -12,9 +12,9 @@
 #include "base/metrics/histogram_snapshot_manager.h"
 
 #include "metrics/metrics_library.h"
-#include "metrics/uploader/metrics_log.h"
-#include "metrics/uploader/sender.h"
-#include "metrics/uploader/system_profile_cache.h"
+#include "uploader/metrics_log.h"
+#include "uploader/sender.h"
+#include "uploader/system_profile_cache.h"
 
 namespace metrics {
 class ChromeUserMetricsExtension;
diff --git a/metrics/uploader/upload_service_test.cc b/metrics/uploader/upload_service_test.cc
index ee17e15..fb08464 100644
--- a/metrics/uploader/upload_service_test.cc
+++ b/metrics/uploader/upload_service_test.cc
@@ -9,16 +9,16 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/logging.h"
 #include "base/sys_info.h"
-#include "metrics/metrics_library_mock.h"
-#include "metrics/serialization/metric_sample.h"
-#include "metrics/uploader/metrics_log.h"
-#include "metrics/uploader/mock/mock_system_profile_setter.h"
-#include "metrics/uploader/mock/sender_mock.h"
-#include "metrics/uploader/proto/chrome_user_metrics_extension.pb.h"
-#include "metrics/uploader/proto/histogram_event.pb.h"
-#include "metrics/uploader/proto/system_profile.pb.h"
-#include "metrics/uploader/system_profile_cache.h"
-#include "metrics/uploader/upload_service.h"
+#include "metrics_library_mock.h"
+#include "serialization/metric_sample.h"
+#include "uploader/metrics_log.h"
+#include "uploader/mock/mock_system_profile_setter.h"
+#include "uploader/mock/sender_mock.h"
+#include "uploader/proto/chrome_user_metrics_extension.pb.h"
+#include "uploader/proto/histogram_event.pb.h"
+#include "uploader/proto/system_profile.pb.h"
+#include "uploader/system_profile_cache.h"
+#include "uploader/upload_service.h"
 
 static const char kMetricsServer[] = "https://clients4.google.com/uma/v2";
 static const char kMetricsFilePath[] = "/var/run/metrics/uma-events";