Commit 83b94acc authored by gunsch's avatar gunsch Committed by Commit bot

Chromecast: provides a method to check if config has been set by user.

R=lcwu@chromium.org,byungchul@chromium.org
BUG=None

Review URL: https://codereview.chromium.org/603243003

Cr-Commit-Position: refs/heads/master@{#296971}
parent c9c86ac1
...@@ -138,4 +138,9 @@ void ChromecastConfig::SetIntValue(const std::string& key, int value) const { ...@@ -138,4 +138,9 @@ void ChromecastConfig::SetIntValue(const std::string& key, int value) const {
} }
} }
bool ChromecastConfig::HasValue(const std::string& key) const {
DCHECK(thread_checker_.CalledOnValidThread());
return pref_service_->HasPrefPath(key.c_str());
}
} // namespace chromecast } // namespace chromecast
...@@ -37,18 +37,21 @@ class ChromecastConfig { ...@@ -37,18 +37,21 @@ class ChromecastConfig {
// Saves configs into configuration file. // Saves configs into configuration file.
void Save() const; void Save() const;
// Returns string value for key, if present. // Returns string value for |key|, if present.
const std::string GetValue(const std::string& key) const; const std::string GetValue(const std::string& key) const;
// Returns integer value for key, if present. // Returns integer value for |key|, if present.
const int GetIntValue(const std::string& key) const; const int GetIntValue(const std::string& key) const;
// Sets new string value for key. // Sets new string value for |key|.
void SetValue(const std::string& key, const std::string& value) const; void SetValue(const std::string& key, const std::string& value) const;
// Sets new int value for key. // Sets new int value for |key|.
void SetIntValue(const std::string& key, int value) const; void SetIntValue(const std::string& key, int value) const;
// Whether or not a value has been set for |key|.
bool HasValue(const std::string& key) const;
scoped_refptr<base::SequencedWorkerPool> worker_pool() const { scoped_refptr<base::SequencedWorkerPool> worker_pool() const {
return worker_pool_; return worker_pool_;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment