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

Side by Side Diff: chrome_frame/policy_settings.h

Issue 18770009: Added a new policy setting as well as corrisponding registry key to allow GCF users the option to d… (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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) 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 11 matching lines...) Expand all
22 RENDER_IN_HOST, 22 RENDER_IN_HOST,
23 RENDER_IN_CHROME_FRAME, 23 RENDER_IN_CHROME_FRAME,
24 }; 24 };
25 25
26 static PolicySettings* GetInstance(); 26 static PolicySettings* GetInstance();
27 27
28 RendererForUrl default_renderer() const { 28 RendererForUrl default_renderer() const {
29 return default_renderer_; 29 return default_renderer_;
30 } 30 }
31 31
32 typedef enum PerformMetadataCheck {
grt (UTC plus 2) 2013/08/01 19:22:57 remove typedef here and above because they are mea
grt (UTC plus 2) 2013/08/01 19:22:57 Unless I'm mistaken, the polarity of this is backw
grt (UTC plus 2) 2013/08/01 19:22:57 as mentioned before, this enum must be moved up so
33 METADATA_CHECK_NOT_SPECIFIED = -1,
grt (UTC plus 2) 2013/08/01 19:22:57 two-space indent here rather than four.
34 METADATA_CHECK_NO,
35 METADATA_CHECK_YES,
36 };
37
38 PerformMetadataCheck metadata_check() const {
39 return metadata_check_;
40 }
41
32 RendererForUrl GetRendererForUrl(const wchar_t* url); 42 RendererForUrl GetRendererForUrl(const wchar_t* url);
33 43
34 RendererForUrl GetRendererForContentType(const wchar_t* content_type); 44 RendererForUrl GetRendererForContentType(const wchar_t* content_type);
35 45
36 // Returns the policy-configured Chrome app locale, or an empty string if none 46 // Returns the policy-configured Chrome app locale, or an empty string if none
37 // is configured. 47 // is configured.
38 const std::wstring& ApplicationLocale() const { 48 const std::wstring& ApplicationLocale() const {
39 return application_locale_; 49 return application_locale_;
40 } 50 }
41 51
42 // Contains additional parameters that can optionally be configured for the 52 // Contains additional parameters that can optionally be configured for the
43 // current user via the policy settings. The program part of this command 53 // 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. 54 // line object must not be used when appending to another command line.
45 const CommandLine& AdditionalLaunchParameters() const; 55 const CommandLine& AdditionalLaunchParameters() const;
46 56
47 // Returns true if the Chrome Frame turndown prompt should be suppressed. 57 // Returns true if the Chrome Frame turndown prompt should be suppressed.
48 bool suppress_turndown_prompt() const { 58 bool suppress_turndown_prompt() const {
49 return suppress_turndown_prompt_; 59 return suppress_turndown_prompt_;
50 } 60 }
51 61
52 // Helper functions for reading settings from the registry 62 // Helper functions for reading settings from the registry
53 static void ReadUrlSettings(RendererForUrl* default_renderer, 63 static void ReadUrlSettings(RendererForUrl* default_renderer,
54 std::vector<std::wstring>* renderer_exclusion_list); 64 std::vector<std::wstring>* renderer_exclusion_list);
65 static void ReadMetadataCheckSettings(PerformMetadataCheck* metadata_check);
55 static void ReadContentTypeSetting( 66 static void ReadContentTypeSetting(
56 std::vector<std::wstring>* content_type_list); 67 std::vector<std::wstring>* content_type_list);
57 static void ReadStringSetting(const char* value_name, std::wstring* value); 68 static void ReadStringSetting(const char* value_name, std::wstring* value);
58 static void ReadBoolSetting(const char* value_name, bool* value); 69 static void ReadBoolSetting(const char* value_name, bool* value);
59 70
60 protected: 71 protected:
61 PolicySettings() 72 PolicySettings()
62 : default_renderer_(RENDERER_NOT_SPECIFIED), 73 : default_renderer_(RENDERER_NOT_SPECIFIED),
74 metadata_check_(METADATA_CHECK_NOT_SPECIFIED),
63 additional_launch_parameters_(CommandLine::NO_PROGRAM), 75 additional_launch_parameters_(CommandLine::NO_PROGRAM),
64 suppress_turndown_prompt_(false) { 76 suppress_turndown_prompt_(false) {
65 RefreshFromRegistry(); 77 RefreshFromRegistry();
66 } 78 }
67 79
68 ~PolicySettings() { 80 ~PolicySettings() {
69 } 81 }
70 82
71 // Protected for now since the class is not thread safe. 83 // Protected for now since the class is not thread safe.
72 void RefreshFromRegistry(); 84 void RefreshFromRegistry();
73 85
74 protected: 86 protected:
75 RendererForUrl default_renderer_; 87 RendererForUrl default_renderer_;
88 PerformMetadataCheck metadata_check_;
76 std::vector<std::wstring> renderer_exclusion_list_; 89 std::vector<std::wstring> renderer_exclusion_list_;
77 std::vector<std::wstring> content_type_list_; 90 std::vector<std::wstring> content_type_list_;
78 std::wstring application_locale_; 91 std::wstring application_locale_;
79 CommandLine additional_launch_parameters_; 92 CommandLine additional_launch_parameters_;
80 bool suppress_turndown_prompt_; 93 bool suppress_turndown_prompt_;
81 94
82 private: 95 private:
83 // This ensures no construction is possible outside of the class itself. 96 // This ensures no construction is possible outside of the class itself.
84 friend struct DefaultSingletonTraits<PolicySettings>; 97 friend struct DefaultSingletonTraits<PolicySettings>;
85 DISALLOW_COPY_AND_ASSIGN(PolicySettings); 98 DISALLOW_COPY_AND_ASSIGN(PolicySettings);
86 }; 99 };
87 100
88 #endif // CHROME_FRAME_POLICY_SETTINGS_H_ 101 #endif // CHROME_FRAME_POLICY_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698