OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/registry.h" | |
8 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
9 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/win/registry.h" |
11 #include "chrome/common/policy_constants.h" | 11 #include "chrome/common/policy_constants.h" |
12 #include "chrome_frame/policy_settings.h" | 12 #include "chrome_frame/policy_settings.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
| 15 using base::win::RegKey; |
| 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 // A best effort way to zap CF policy entries that may be in the registry. | 19 // A best effort way to zap CF policy entries that may be in the registry. |
18 void DeleteChromeFramePolicyEntries(HKEY root) { | 20 void DeleteChromeFramePolicyEntries(HKEY root) { |
19 RegKey key; | 21 RegKey key; |
20 if (key.Open(root, policy::kRegistrySubKey, KEY_ALL_ACCESS)) { | 22 if (key.Open(root, policy::kRegistrySubKey, KEY_ALL_ACCESS)) { |
21 key.DeleteValue( | 23 key.DeleteValue( |
22 ASCIIToWide(policy::key::kChromeFrameRendererSettings).c_str()); | 24 ASCIIToWide(policy::key::kChromeFrameRendererSettings).c_str()); |
23 key.DeleteKey(ASCIIToWide(policy::key::kRenderInChromeFrameList).c_str()); | 25 key.DeleteKey(ASCIIToWide(policy::key::kRenderInChromeFrameList).c_str()); |
24 key.DeleteKey(ASCIIToWide(policy::key::kRenderInHostList).c_str()); | 26 key.DeleteKey(ASCIIToWide(policy::key::kRenderInHostList).c_str()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 kTestPolicyContentTypes[type])); | 208 kTestPolicyContentTypes[type])); |
207 } | 209 } |
208 | 210 |
209 EXPECT_EQ(PolicySettings::RENDERER_NOT_SPECIFIED, | 211 EXPECT_EQ(PolicySettings::RENDERER_NOT_SPECIFIED, |
210 settings->GetRendererForContentType(L"text/html")); | 212 settings->GetRendererForContentType(L"text/html")); |
211 | 213 |
212 DeleteChromeFramePolicyEntries(root[i]); | 214 DeleteChromeFramePolicyEntries(root[i]); |
213 } | 215 } |
214 } | 216 } |
215 | 217 |
OLD | NEW |