| OLD | NEW |
| 1 // Copyright (c) 2010 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 #include "chrome_frame/policy_settings.h" | 5 #include "chrome_frame/policy_settings.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 *default_renderer = RENDERER_NOT_SPECIFIED; | 65 *default_renderer = RENDERER_NOT_SPECIFIED; |
| 66 renderer_exclusion_list->clear(); | 66 renderer_exclusion_list->clear(); |
| 67 | 67 |
| 68 base::win::RegKey config_key; | 68 base::win::RegKey config_key; |
| 69 DWORD value = RENDERER_NOT_SPECIFIED; | 69 DWORD value = RENDERER_NOT_SPECIFIED; |
| 70 std::wstring settings_value( | 70 std::wstring settings_value( |
| 71 ASCIIToWide(policy::key::kChromeFrameRendererSettings)); | 71 ASCIIToWide(policy::key::kChromeFrameRendererSettings)); |
| 72 for (int i = 0; i < arraysize(kRootKeys); ++i) { | 72 for (int i = 0; i < arraysize(kRootKeys); ++i) { |
| 73 if ((config_key.Open(kRootKeys[i], policy::kRegistrySubKey, | 73 if ((config_key.Open(kRootKeys[i], policy::kRegistrySubKey, |
| 74 KEY_READ) == ERROR_SUCCESS) && | 74 KEY_READ) == ERROR_SUCCESS) && |
| 75 (config_key.ReadValueDW(settings_value.c_str(), | 75 (config_key.ReadValue(settings_value.c_str(), |
| 76 &value) == ERROR_SUCCESS)) { | 76 &value) == ERROR_SUCCESS)) { |
| 77 break; | 77 break; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 DCHECK(value == RENDERER_NOT_SPECIFIED || | 81 DCHECK(value == RENDERER_NOT_SPECIFIED || |
| 82 value == RENDER_IN_HOST || | 82 value == RENDER_IN_HOST || |
| 83 value == RENDER_IN_CHROME_FRAME) << | 83 value == RENDER_IN_CHROME_FRAME) << |
| 84 "invalid default renderer setting: " << value; | 84 "invalid default renderer setting: " << value; |
| 85 | 85 |
| 86 if (value != RENDER_IN_HOST && value != RENDER_IN_CHROME_FRAME) { | 86 if (value != RENDER_IN_HOST && value != RENDER_IN_CHROME_FRAME) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 swap(default_renderer_, default_renderer); | 153 swap(default_renderer_, default_renderer); |
| 154 swap(renderer_exclusion_list_, renderer_exclusion_list); | 154 swap(renderer_exclusion_list_, renderer_exclusion_list); |
| 155 swap(content_type_list_, content_type_list); | 155 swap(content_type_list_, content_type_list); |
| 156 swap(application_locale_, application_locale); | 156 swap(application_locale_, application_locale); |
| 157 } | 157 } |
| 158 | 158 |
| 159 // static | 159 // static |
| 160 PolicySettings* PolicySettings::GetInstance() { | 160 PolicySettings* PolicySettings::GetInstance() { |
| 161 return Singleton<PolicySettings>::get(); | 161 return Singleton<PolicySettings>::get(); |
| 162 } | 162 } |
| OLD | NEW |