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

Side by Side Diff: blimp/client/core/settings/settings.h

Issue 2349073002: Blimp Settings framework on the c++ side (Closed)
Patch Set: Remove OnRecordWholeDocumentChanged from SettingsObserver and SettingsFeature Created 4 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_CLIENT_CORE_SETTINGS_SETTINGS_H_
6 #define BLIMP_CLIENT_CORE_SETTINGS_SETTINGS_H_
7
8 #include "base/macros.h"
9 #include "base/observer_list.h"
10
11 class PrefRegistrySimple;
12 class PrefService;
13
14 namespace blimp {
15 namespace client {
16
17 class SettingsObserver;
18
19 class Settings {
20 public:
21 explicit Settings(PrefService* local_state);
22 virtual ~Settings();
23
24 static void RegisterPrefs(PrefRegistrySimple* registry);
25
26 void AddObserver(SettingsObserver* observer);
27 void RemoveObserver(SettingsObserver* observer);
28
29 // Set blimp_enabled_, and save it to the persistent storage.
30 void SetEnableBlimpMode(bool enable);
31
32 // Set record_whole_document_, and save it to the persistent storage.
33 void SetRecordWholeDocument(bool enable);
34
35 // Set show_network_stats_.
36 void SetShowNetworkStats(bool enable);
37
38 bool blimp_enabled() { return blimp_enabled_; }
39 bool record_whole_document() { return record_whole_document_; }
40 bool show_network_stats() { return show_network_stats_; }
41
42 private:
43 // The pref service used to store the persistent settings.
44 PrefService* local_state_;
45
46 // A list of all the observers of the Blimp Settings.
47 base::ObserverList<SettingsObserver> observers_;
48
49 // Called in Settings' constructor.
50 // It gets blimp_enabled_ and record_whole_document_ from command line or
David Trainor- moved to gerrit 2016/10/07 07:04:59 Maybe keep this generic. It'll get dated quickly.
Menglin 2016/10/08 00:20:55 very well worded. thank you
51 // persistent storage.
52 void InitializeFromCommandLineAndPref();
53
54 // Whether or not Blimp mode is enabled.
55 // Can be changed via: command line --enable-blimp, setting dialog.
56 // Persisted across restarts: Yes.
57 bool blimp_enabled_;
58
59 // Whether or not the engine sends the whole webpage at once or pieces of it
60 // based on the current viewport.
61 // Can be changed via: command line --download-whole-document, setting dialog.
62 // Persisted across restarts: Yes.
63 bool record_whole_document_;
64
65 // Whether or not to show the network stats.
66 // Can be changed via: setting dialog.
67 // Persisted across restarts: No.
68 bool show_network_stats_;
69
70 DISALLOW_COPY_AND_ASSIGN(Settings);
71 };
72
73 } // namespace client
74 } // namespace blimp
75
76 #endif // BLIMP_CLIENT_CORE_SETTINGS_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698