Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc

Issue 624173002: replace OVERRIDE and FINAL with override and final in chrome/browser/[j-q]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium 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 #include "base/observer_list.h" 5 #include "base/observer_list.h"
6 #include "base/prefs/writeable_pref_store.h" 6 #include "base/prefs/writeable_pref_store.h"
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/devtools/devtools_window.h" 8 #include "chrome/browser/devtools/devtools_window.h"
9 #include "chrome/browser/prefs/browser_ui_prefs_migrator.h" 9 #include "chrome/browser/prefs/browser_ui_prefs_migrator.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace { 13 namespace {
14 14
15 class DictionaryPrefStore : public WriteablePrefStore { 15 class DictionaryPrefStore : public WriteablePrefStore {
16 public: 16 public:
17 DictionaryPrefStore() : WriteablePrefStore() {} 17 DictionaryPrefStore() : WriteablePrefStore() {}
18 18
19 // Overrides from PrefStore. 19 // Overrides from PrefStore.
20 virtual void AddObserver(Observer* observer) OVERRIDE { 20 virtual void AddObserver(Observer* observer) override {
21 observers_.AddObserver(observer); 21 observers_.AddObserver(observer);
22 } 22 }
23 23
24 virtual void RemoveObserver(Observer* observer) OVERRIDE { 24 virtual void RemoveObserver(Observer* observer) override {
25 observers_.RemoveObserver(observer); 25 observers_.RemoveObserver(observer);
26 } 26 }
27 27
28 virtual bool GetValue(const std::string& key, 28 virtual bool GetValue(const std::string& key,
29 const base::Value** result) const OVERRIDE { 29 const base::Value** result) const override {
30 return prefs_.Get(key, result); 30 return prefs_.Get(key, result);
31 } 31 }
32 32
33 // Overrides from WriteablePrefStore. 33 // Overrides from WriteablePrefStore.
34 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE { 34 virtual void SetValue(const std::string& key, base::Value* value) override {
35 DCHECK(value); 35 DCHECK(value);
36 prefs_.Set(key, value); 36 prefs_.Set(key, value);
37 ReportValueChanged(key); 37 ReportValueChanged(key);
38 } 38 }
39 39
40 virtual void RemoveValue(const std::string& key) OVERRIDE { 40 virtual void RemoveValue(const std::string& key) override {
41 if (prefs_.RemovePath(key, NULL)) 41 if (prefs_.RemovePath(key, NULL))
42 ReportValueChanged(key); 42 ReportValueChanged(key);
43 } 43 }
44 44
45 virtual bool GetMutableValue(const std::string& key, 45 virtual bool GetMutableValue(const std::string& key,
46 base::Value** result) OVERRIDE { 46 base::Value** result) override {
47 return prefs_.Get(key, result); 47 return prefs_.Get(key, result);
48 } 48 }
49 49
50 virtual void ReportValueChanged(const std::string& key) OVERRIDE {} 50 virtual void ReportValueChanged(const std::string& key) override {}
51 51
52 virtual void SetValueSilently(const std::string& key, 52 virtual void SetValueSilently(const std::string& key,
53 base::Value* value) OVERRIDE { 53 base::Value* value) override {
54 NOTIMPLEMENTED(); 54 NOTIMPLEMENTED();
55 } 55 }
56 56
57 void SignalObservers() { 57 void SignalObservers() {
58 FOR_EACH_OBSERVER( 58 FOR_EACH_OBSERVER(
59 PrefStore::Observer, observers_, OnInitializationCompleted(true)); 59 PrefStore::Observer, observers_, OnInitializationCompleted(true));
60 } 60 }
61 61
62 private: 62 private:
63 virtual ~DictionaryPrefStore() {} 63 virtual ~DictionaryPrefStore() {}
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 EXPECT_EQ(986, out_value); 132 EXPECT_EQ(986, out_value);
133 133
134 ASSERT_TRUE(pref_store->GetValue(prefs::kAppWindowPlacement + 134 ASSERT_TRUE(pref_store->GetValue(prefs::kAppWindowPlacement +
135 std::string(".") + 135 std::string(".") +
136 DevToolsWindow::kDevToolsApp, 136 DevToolsWindow::kDevToolsApp,
137 &value)); 137 &value));
138 ASSERT_TRUE(value->GetAsDictionary(&dictionary)); 138 ASSERT_TRUE(value->GetAsDictionary(&dictionary));
139 EXPECT_TRUE(dictionary->GetInteger("left", &out_value)); 139 EXPECT_TRUE(dictionary->GetInteger("left", &out_value));
140 EXPECT_EQ(700, out_value); 140 EXPECT_EQ(700, out_value);
141 } 141 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_ui_prefs_migrator.h ('k') | chrome/browser/prefs/leveldb_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698