OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
Bernhard Bauer
2016/10/14 10:06:31
Update the copyright? Technically this is a new fi
Menglin
2016/10/14 17:12:04
Done.
| |
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 CHROME_BROWSER_PREFS_CHROME_COMMAND_LINE_PREF_STORE_H_ | |
6 #define CHROME_BROWSER_PREFS_CHROME_COMMAND_LINE_PREF_STORE_H_ | |
7 | |
8 #include "base/command_line.h" | |
9 #include "base/macros.h" | |
10 #include "base/values.h" | |
11 #include "components/prefs/command_line_pref_store.h" | |
12 | |
13 // This PrefStore keeps track of preferences set by command-line switches, | |
14 // such as proxy settings. | |
15 class ChromeCommandLinePrefStore : public CommandLinePrefStore { | |
16 public: | |
17 explicit ChromeCommandLinePrefStore(const base::CommandLine* command_line); | |
18 | |
19 protected: | |
20 ~ChromeCommandLinePrefStore() override; | |
21 | |
22 // Logs a message and returns false if the proxy switches are | |
23 // self-contradictory. Protected so it can be used in unit testing. | |
24 bool ValidateProxySwitches(); | |
Bernhard Bauer
2016/10/14 10:06:31
Not really your fault, but it's a bit weird to mak
Menglin
2016/10/14 17:12:04
ok. for now I add a TODO assigned to you :)
| |
25 | |
26 private: | |
27 friend class TestCommandLinePrefStore; | |
28 | |
29 // Using the string and boolean maps, apply command-line switches to their | |
30 // corresponding preferences in this pref store. | |
31 void ApplySimpleSwitches(); | |
32 | |
33 // Determines the proxy mode preference from the given proxy switches. | |
34 void ApplyProxyMode(); | |
35 | |
36 // Apply the SSL/TLS preferences from the given switches. | |
37 void ApplySSLSwitches(); | |
38 | |
39 // Determines whether the background mode is force-disabled. | |
40 void ApplyBackgroundModeSwitches(); | |
41 | |
42 // Mappings of command line switches to prefs. | |
43 static const BooleanSwitchToPreferenceMapEntry boolean_switch_map_[]; | |
44 static const SwitchToPreferenceMapEntry string_switch_map_[]; | |
45 static const SwitchToPreferenceMapEntry path_switch_map_[]; | |
46 static const SwitchToPreferenceMapEntry integer_switch_map_[]; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(ChromeCommandLinePrefStore); | |
49 }; | |
50 | |
51 #endif // CHROME_BROWSER_PREFS_CHROME_COMMAND_LINE_PREF_STORE_H_ | |
OLD | NEW |