Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PREFS_COMMAND_LINE_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_COMMAND_LINE_PREF_STORE_H_ |
| 6 #define CHROME_BROWSER_PREFS_COMMAND_LINE_PREF_STORE_H_ | 6 #define CHROME_BROWSER_PREFS_COMMAND_LINE_PREF_STORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 // Logs a message and returns false if the proxy switches are | 23 // Logs a message and returns false if the proxy switches are |
| 24 // self-contradictory. Protected so it can be used in unit testing. | 24 // self-contradictory. Protected so it can be used in unit testing. |
| 25 bool ValidateProxySwitches(); | 25 bool ValidateProxySwitches(); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 struct StringSwitchToPreferenceMapEntry { | 28 struct StringSwitchToPreferenceMapEntry { |
| 29 const char* switch_name; | 29 const char* switch_name; |
| 30 const char* preference_path; | 30 const char* preference_path; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 struct IntegerSwitchToPreferenceMapEntry { | |
| 34 const char* switch_name; | |
| 35 const char* preference_path; | |
| 36 }; | |
| 37 | |
| 33 // |set_value| indicates what the preference should be set to if the switch | 38 // |set_value| indicates what the preference should be set to if the switch |
| 34 // is present. | 39 // is present. |
| 35 struct BooleanSwitchToPreferenceMapEntry { | 40 struct BooleanSwitchToPreferenceMapEntry { |
| 36 const char* switch_name; | 41 const char* switch_name; |
| 37 const char* preference_path; | 42 const char* preference_path; |
| 38 bool set_value; | 43 bool set_value; |
| 39 }; | 44 }; |
| 40 static const BooleanSwitchToPreferenceMapEntry boolean_switch_map_[]; | 45 static const BooleanSwitchToPreferenceMapEntry boolean_switch_map_[]; |
|
Joao da Silva
2011/11/16 16:10:42
Nit: please move this next to the other arrays
pastarmovj
2011/11/17 13:10:10
Done. Extra treat commented the section too :)
| |
| 41 | 46 |
| 42 // Using the string and boolean maps, apply command-line switches to their | 47 // Using the string and boolean maps, apply command-line switches to their |
| 43 // corresponding preferences in this pref store. | 48 // corresponding preferences in this pref store. |
| 44 void ApplySimpleSwitches(); | 49 void ApplySimpleSwitches(); |
| 45 | 50 |
| 46 // Determines the proxy mode preference from the given proxy switches. | 51 // Determines the proxy mode preference from the given proxy switches. |
| 47 void ApplyProxyMode(); | 52 void ApplyProxyMode(); |
| 48 | 53 |
| 49 // Apply the SSL/TLS preferences from the given switches. | 54 // Apply the SSL/TLS preferences from the given switches. |
| 50 void ApplySSLSwitches(); | 55 void ApplySSLSwitches(); |
| 51 | 56 |
| 52 // Weak reference. | 57 // Weak reference. |
| 53 const CommandLine* command_line_; | 58 const CommandLine* command_line_; |
| 54 | 59 |
| 55 static const StringSwitchToPreferenceMapEntry string_switch_map_[]; | 60 static const StringSwitchToPreferenceMapEntry string_switch_map_[]; |
| 61 static const IntegerSwitchToPreferenceMapEntry integer_switch_map_[]; | |
| 56 | 62 |
| 57 DISALLOW_COPY_AND_ASSIGN(CommandLinePrefStore); | 63 DISALLOW_COPY_AND_ASSIGN(CommandLinePrefStore); |
| 58 }; | 64 }; |
| 59 | 65 |
| 60 #endif // CHROME_BROWSER_PREFS_COMMAND_LINE_PREF_STORE_H_ | 66 #endif // CHROME_BROWSER_PREFS_COMMAND_LINE_PREF_STORE_H_ |
| OLD | NEW |