Remove IsOfficialBuild() from other singleton interfaces.

IsOfficialBuild() is replicated on other singleton interfaces as a
shortcut for accessing the new HardwareInterface. These shortcuts
were used for testing when it wasn't possible to fake out this value
in a more standard way.

This patch removes the IsOfficialBuild() method from all the
singleton interfaces and uses HardwareInterface directly, which
can be faked via the default FakeHardware on MockSystemState.
This helps reduce the actual dependencies on the
UpdateCheckScheduler before migrate it to the PolicyManager.

Some minor linter issues are also solved on this patch.

BUG=chromium:358269
TEST=Unittests still pass.

Change-Id: I19d5add04b8cdc679e918cbc7fe27f688e8da64e
Reviewed-on: https://chromium-review.googlesource.com/192974
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/http_fetcher_unittest.cc b/http_fetcher_unittest.cc
index f09bf52..9044129 100644
--- a/http_fetcher_unittest.cc
+++ b/http_fetcher_unittest.cc
@@ -199,7 +199,7 @@
     mock_system_state_.set_connection_manager(&mock_connection_manager_);
   }
 
- virtual HttpFetcher* NewLargeFetcher(size_t num_proxies) = 0;
+  virtual HttpFetcher* NewLargeFetcher(size_t num_proxies) = 0;
   HttpFetcher* NewLargeFetcher() {
     return NewLargeFetcher(1);
   }
@@ -272,7 +272,7 @@
     // Speed up test execution.
     ret->set_idle_seconds(1);
     ret->set_retry_seconds(1);
-    ret->SetBuildType(false);
+    mock_system_state_.get_fake_hardware()->SetIsOfficialBuild(false);
     return ret;
   }
 
@@ -323,7 +323,7 @@
     // Speed up test execution.
     ret->set_idle_seconds(1);
     ret->set_retry_seconds(1);
-    ret->SetBuildType(false);
+    mock_system_state_.get_fake_hardware()->SetIsOfficialBuild(false);
     return ret;
   }
 
@@ -1057,7 +1057,8 @@
       }
       LOG(INFO) << "added range: " << tmp_str;
     }
-    multi_fetcher->SetBuildType(false);
+    dynamic_cast<MockSystemState*>(fetcher_in->GetSystemState())
+        ->get_fake_hardware()->SetIsOfficialBuild(false);
     multi_fetcher->set_delegate(&delegate);
 
     StartTransferArgs start_xfer_args = {multi_fetcher, url};
@@ -1244,7 +1245,9 @@
       bool is_official_build = (i == 1);
       LOG(INFO) << "is_update_allowed_over_connection: " << is_allowed;
       LOG(INFO) << "is_official_build: " << is_official_build;
-      fetcher->SetBuildType(is_official_build);
+      // NewLargeFetcher creates the HttpFetcher* with a MockSystemState.
+      dynamic_cast<MockSystemState*>(fetcher->GetSystemState())
+          ->get_fake_hardware()->SetIsOfficialBuild(is_official_build);
       fetcher->set_delegate(&delegate);
 
       StartTransferArgs start_xfer_args =