OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FRAME_POLICY_SETTINGS_H_ | 5 #ifndef CHROME_FRAME_POLICY_SETTINGS_H_ |
6 #define CHROME_FRAME_POLICY_SETTINGS_H_ | 6 #define CHROME_FRAME_POLICY_SETTINGS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 // is configured. | 37 // is configured. |
38 const std::wstring& ApplicationLocale() const { | 38 const std::wstring& ApplicationLocale() const { |
39 return application_locale_; | 39 return application_locale_; |
40 } | 40 } |
41 | 41 |
42 // Contains additional parameters that can optionally be configured for the | 42 // Contains additional parameters that can optionally be configured for the |
43 // current user via the policy settings. The program part of this command | 43 // current user via the policy settings. The program part of this command |
44 // line object must not be used when appending to another command line. | 44 // line object must not be used when appending to another command line. |
45 const CommandLine& AdditionalLaunchParameters() const; | 45 const CommandLine& AdditionalLaunchParameters() const; |
46 | 46 |
| 47 // Returns true if the Chrome Frame turndown prompt should be suppressed. |
| 48 bool suppress_turndown_prompt() const { |
| 49 return suppress_turndown_prompt_; |
| 50 } |
| 51 |
47 // Helper functions for reading settings from the registry | 52 // Helper functions for reading settings from the registry |
48 static void ReadUrlSettings(RendererForUrl* default_renderer, | 53 static void ReadUrlSettings(RendererForUrl* default_renderer, |
49 std::vector<std::wstring>* renderer_exclusion_list); | 54 std::vector<std::wstring>* renderer_exclusion_list); |
50 static void ReadContentTypeSetting( | 55 static void ReadContentTypeSetting( |
51 std::vector<std::wstring>* content_type_list); | 56 std::vector<std::wstring>* content_type_list); |
52 static void ReadStringSetting(const char* value_name, std::wstring* value); | 57 static void ReadStringSetting(const char* value_name, std::wstring* value); |
| 58 static void ReadBoolSetting(const char* value_name, bool* value); |
53 | 59 |
54 protected: | 60 protected: |
55 PolicySettings() | 61 PolicySettings() |
56 : default_renderer_(RENDERER_NOT_SPECIFIED), | 62 : default_renderer_(RENDERER_NOT_SPECIFIED), |
57 additional_launch_parameters_(CommandLine::NO_PROGRAM) { | 63 additional_launch_parameters_(CommandLine::NO_PROGRAM), |
| 64 suppress_turndown_prompt_(false) { |
58 RefreshFromRegistry(); | 65 RefreshFromRegistry(); |
59 } | 66 } |
60 | 67 |
61 ~PolicySettings() { | 68 ~PolicySettings() { |
62 } | 69 } |
63 | 70 |
64 // Protected for now since the class is not thread safe. | 71 // Protected for now since the class is not thread safe. |
65 void RefreshFromRegistry(); | 72 void RefreshFromRegistry(); |
66 | 73 |
67 protected: | 74 protected: |
68 RendererForUrl default_renderer_; | 75 RendererForUrl default_renderer_; |
69 std::vector<std::wstring> renderer_exclusion_list_; | 76 std::vector<std::wstring> renderer_exclusion_list_; |
70 std::vector<std::wstring> content_type_list_; | 77 std::vector<std::wstring> content_type_list_; |
71 std::wstring application_locale_; | 78 std::wstring application_locale_; |
72 CommandLine additional_launch_parameters_; | 79 CommandLine additional_launch_parameters_; |
| 80 bool suppress_turndown_prompt_; |
73 | 81 |
74 private: | 82 private: |
75 // This ensures no construction is possible outside of the class itself. | 83 // This ensures no construction is possible outside of the class itself. |
76 friend struct DefaultSingletonTraits<PolicySettings>; | 84 friend struct DefaultSingletonTraits<PolicySettings>; |
77 DISALLOW_COPY_AND_ASSIGN(PolicySettings); | 85 DISALLOW_COPY_AND_ASSIGN(PolicySettings); |
78 }; | 86 }; |
79 | 87 |
80 #endif // CHROME_FRAME_POLICY_SETTINGS_H_ | 88 #endif // CHROME_FRAME_POLICY_SETTINGS_H_ |
OLD | NEW |