OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include <base/basictypes.h> | 10 #include <base/basictypes.h> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // |in_app_version| or |in_update_url| prevents automatic detection | 73 // |in_app_version| or |in_update_url| prevents automatic detection |
74 // of the parameter. Returns true on success, false otherwise. | 74 // of the parameter. Returns true on success, false otherwise. |
75 bool Init(const std::string& in_app_version, | 75 bool Init(const std::string& in_app_version, |
76 const std::string& in_update_url); | 76 const std::string& in_update_url); |
77 | 77 |
78 // Permanently changes the release track to |track|. Returns true on success, | 78 // Permanently changes the release track to |track|. Returns true on success, |
79 // false otherwise. | 79 // false otherwise. |
80 bool SetTrack(const std::string& track); | 80 bool SetTrack(const std::string& track); |
81 static bool SetDeviceTrack(const std::string& track); | 81 static bool SetDeviceTrack(const std::string& track); |
82 | 82 |
| 83 // Returns the release track. On error, returns an empty string. |
| 84 static std::string GetDeviceTrack(); |
| 85 |
83 // For unit-tests. | 86 // For unit-tests. |
84 void set_root(const std::string& root) { root_ = root; } | 87 void set_root(const std::string& root) { root_ = root; } |
85 | 88 |
86 // Force build type for testing purposes. | 89 // Force build type for testing purposes. |
87 void SetBuildTypeOfficial(bool is_official); | 90 void SetBuildTypeOfficial(bool is_official); |
88 | 91 |
89 private: | 92 private: |
90 FRIEND_TEST(OmahaRequestDeviceParamsTest, IsValidTrackTest); | 93 FRIEND_TEST(OmahaRequestDeviceParamsTest, IsValidTrackTest); |
91 | 94 |
92 // Use a validator that is a non-static member of this class so that its | 95 // Use a validator that is a non-static member of this class so that its |
(...skipping 30 matching lines...) Expand all Loading... |
123 // Force build type for testing purposes. | 126 // Force build type for testing purposes. |
124 bool force_build_type_; | 127 bool force_build_type_; |
125 bool forced_official_build_; | 128 bool forced_official_build_; |
126 | 129 |
127 DISALLOW_COPY_AND_ASSIGN(OmahaRequestDeviceParams); | 130 DISALLOW_COPY_AND_ASSIGN(OmahaRequestDeviceParams); |
128 }; | 131 }; |
129 | 132 |
130 } // namespace chromeos_update_engine | 133 } // namespace chromeos_update_engine |
131 | 134 |
132 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__ | 135 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__ |
OLD | NEW |