summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-28 14:57:54 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-28 14:57:54 +0000
commit5a4c4bb277e9673fd17f1262c5fcbed747c534f4 (patch)
treea92ed90766459dbf88501475565987e526fde1b6
parent4e0616edf0c949858b67859b6f27a0c573425988 (diff)
downloadchromium_src-5a4c4bb277e9673fd17f1262c5fcbed747c534f4.zip
chromium_src-5a4c4bb277e9673fd17f1262c5fcbed747c534f4.tar.gz
chromium_src-5a4c4bb277e9673fd17f1262c5fcbed747c534f4.tar.bz2
Rename class to comply with style guide. Tweak comments for grammar and correctness.
BUG=none TEST=n/a Review URL: http://codereview.chromium.org/2273003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48485 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/browser/configuration_policy_provider_win.cc24
-rwxr-xr-xchrome/browser/configuration_policy_provider_win.h12
-rwxr-xr-xchrome/browser/configuration_policy_provider_win_unittest.cc86
3 files changed, 61 insertions, 61 deletions
diff --git a/chrome/browser/configuration_policy_provider_win.cc b/chrome/browser/configuration_policy_provider_win.cc
index f64ea63..f81758f6 100755
--- a/chrome/browser/configuration_policy_provider_win.cc
+++ b/chrome/browser/configuration_policy_provider_win.cc
@@ -12,25 +12,25 @@
#include "base/sys_string_conversions.h"
#include "base/values.h"
-const wchar_t WinConfigurationPolicyProvider::kHomepageRegistryValueName[] =
+const wchar_t ConfigurationPolicyProviderWin::kHomepageRegistryValueName[] =
L"Homepage";
-const wchar_t WinConfigurationPolicyProvider::
+const wchar_t ConfigurationPolicyProviderWin::
kHomepageIsNewTabPageRegistryValueName[] = L"HomepageIsNewTabPage";
-const wchar_t WinConfigurationPolicyProvider::kCookiesModeRegistryValueName[] =
+const wchar_t ConfigurationPolicyProviderWin::kCookiesModeRegistryValueName[] =
L"CookiesMode";
#if defined(GOOGLE_CHROME_BUILD)
-const wchar_t WinConfigurationPolicyProvider::kPolicyRegistrySubKey[] =
+const wchar_t ConfigurationPolicyProviderWin::kPolicyRegistrySubKey[] =
L"SOFTWARE\\Policies\\Google\\Google Chrome";
#else
-const wchar_t WinConfigurationPolicyProvider::kPolicyRegistrySubKey[] =
+const wchar_t ConfigurationPolicyProviderWin::kPolicyRegistrySubKey[] =
L"SOFTWARE\\Policies\\Chromium";
#endif
-WinConfigurationPolicyProvider::WinConfigurationPolicyProvider() {
+ConfigurationPolicyProviderWin::ConfigurationPolicyProviderWin() {
}
-bool WinConfigurationPolicyProvider::GetRegistryPolicyString(
+bool ConfigurationPolicyProviderWin::GetRegistryPolicyString(
const wchar_t* value_name, string16* result) {
DWORD value_size = 0;
DWORD key_type = 0;
@@ -67,7 +67,7 @@ bool WinConfigurationPolicyProvider::GetRegistryPolicyString(
return true;
}
-bool WinConfigurationPolicyProvider::GetRegistryPolicyBoolean(
+bool ConfigurationPolicyProviderWin::GetRegistryPolicyBoolean(
const wchar_t* value_name, bool* result) {
DWORD value;
RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, kPolicyRegistrySubKey);
@@ -84,7 +84,7 @@ bool WinConfigurationPolicyProvider::GetRegistryPolicyBoolean(
return false;
}
-bool WinConfigurationPolicyProvider::GetRegistryPolicyInteger(
+bool ConfigurationPolicyProviderWin::GetRegistryPolicyInteger(
const wchar_t* value_name, uint32* result) {
DWORD value;
RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, kPolicyRegistrySubKey);
@@ -101,8 +101,8 @@ bool WinConfigurationPolicyProvider::GetRegistryPolicyInteger(
return false;
}
-const WinConfigurationPolicyProvider::RegistryPolicyMapEntry
- WinConfigurationPolicyProvider::registry_to_policy_map_[] = {
+const ConfigurationPolicyProviderWin::RegistryPolicyMapEntry
+ ConfigurationPolicyProviderWin::registry_to_policy_map_[] = {
{ Value::TYPE_STRING,
ConfigurationPolicyStore::kPolicyHomePage,
kHomepageRegistryValueName },
@@ -114,7 +114,7 @@ const WinConfigurationPolicyProvider::RegistryPolicyMapEntry
kCookiesModeRegistryValueName },
};
-bool WinConfigurationPolicyProvider::Provide(
+bool ConfigurationPolicyProviderWin::Provide(
ConfigurationPolicyStore* store) {
const RegistryPolicyMapEntry* current;
const RegistryPolicyMapEntry* end = registry_to_policy_map_ +
diff --git a/chrome/browser/configuration_policy_provider_win.h b/chrome/browser/configuration_policy_provider_win.h
index ccf8a24..235e2ee1 100755
--- a/chrome/browser/configuration_policy_provider_win.h
+++ b/chrome/browser/configuration_policy_provider_win.h
@@ -14,16 +14,16 @@
// On a managed machine in a domain, this portion of the registry is
// periodically updated by the Windows Group Policy machinery to contain
// the latest version of the policy set by administrators.
-class WinConfigurationPolicyProvider : public ConfigurationPolicyProvider {
+class ConfigurationPolicyProviderWin : public ConfigurationPolicyProvider {
public:
- WinConfigurationPolicyProvider();
- virtual ~WinConfigurationPolicyProvider() { }
+ ConfigurationPolicyProviderWin();
+ virtual ~ConfigurationPolicyProviderWin() { }
// ConfigurationPolicyProvider method overrides:
virtual bool Provide(ConfigurationPolicyStore* store);
protected:
- // The sub key path for Chromiums's Group Policy information in the
+ // The sub key path for Chromium's Group Policy information in the
// Windows registry.
static const wchar_t kPolicyRegistrySubKey[];
@@ -46,8 +46,8 @@ class WinConfigurationPolicyProvider : public ConfigurationPolicyProvider {
static const RegistryPolicyMapEntry registry_to_policy_map_[];
- // Methods to perfrom type-specific policy lookups in the registry
- // HKLM is checked fist, then HKLM.
+ // Methods to perfrom type-specific policy lookups in the registry.
+ // HKLM is checked first, then HKCU.
bool GetRegistryPolicyString(const wchar_t* value_name, string16* result);
bool GetRegistryPolicyBoolean(const wchar_t* value_name, bool* result);
bool GetRegistryPolicyInteger(const wchar_t* value_name, uint32* result);
diff --git a/chrome/browser/configuration_policy_provider_win_unittest.cc b/chrome/browser/configuration_policy_provider_win_unittest.cc
index 7302b96..a63c6dc 100755
--- a/chrome/browser/configuration_policy_provider_win_unittest.cc
+++ b/chrome/browser/configuration_policy_provider_win_unittest.cc
@@ -21,13 +21,13 @@ const wchar_t kUnitTestUserOverrideSubKey[] =
L"SOFTWARE\\Chromium Unit Tests\\HKCU Override";
}
-// A subclass of |WinConfigurationPolicyProvider| providing access to
+// A subclass of |ConfigurationPolicyProviderWin| providing access to
// internal protected constants without an orgy of FRIEND_TESTS.
-class TestWinConfigurationPolicyProvider
- : public WinConfigurationPolicyProvider {
+class TestConfigurationPolicyProviderWin
+ : public ConfigurationPolicyProviderWin {
public:
- TestWinConfigurationPolicyProvider() : WinConfigurationPolicyProvider() { }
- virtual ~TestWinConfigurationPolicyProvider() { }
+ TestConfigurationPolicyProviderWin() : ConfigurationPolicyProviderWin() { }
+ virtual ~TestConfigurationPolicyProviderWin() { }
void SetHomepageRegistryValue(HKEY hive, const wchar_t* value);
void SetHomepageRegistryValueWrongType(HKEY hive);
@@ -35,46 +35,46 @@ class TestWinConfigurationPolicyProvider
void SetCookiesMode(HKEY hive, uint32 value);
};
-void TestWinConfigurationPolicyProvider::SetHomepageRegistryValue(
+void TestConfigurationPolicyProviderWin::SetHomepageRegistryValue(
HKEY hive,
const wchar_t* value) {
RegKey key(hive,
- WinConfigurationPolicyProvider::kPolicyRegistrySubKey,
+ ConfigurationPolicyProviderWin::kPolicyRegistrySubKey,
KEY_ALL_ACCESS);
EXPECT_TRUE(key.WriteValue(
- WinConfigurationPolicyProvider::kHomepageRegistryValueName,
+ ConfigurationPolicyProviderWin::kHomepageRegistryValueName,
value));
}
-void TestWinConfigurationPolicyProvider::SetHomepageRegistryValueWrongType(
+void TestConfigurationPolicyProviderWin::SetHomepageRegistryValueWrongType(
HKEY hive) {
RegKey key(hive,
- WinConfigurationPolicyProvider::kPolicyRegistrySubKey,
+ ConfigurationPolicyProviderWin::kPolicyRegistrySubKey,
KEY_ALL_ACCESS);
EXPECT_TRUE(key.WriteValue(
- WinConfigurationPolicyProvider::kHomepageRegistryValueName,
+ ConfigurationPolicyProviderWin::kHomepageRegistryValueName,
5));
}
-void TestWinConfigurationPolicyProvider::SetHomepageIsNewTabPage(
+void TestConfigurationPolicyProviderWin::SetHomepageIsNewTabPage(
HKEY hive,
bool value) {
RegKey key(hive,
- WinConfigurationPolicyProvider::kPolicyRegistrySubKey,
+ ConfigurationPolicyProviderWin::kPolicyRegistrySubKey,
KEY_ALL_ACCESS);
EXPECT_TRUE(key.WriteValue(
- WinConfigurationPolicyProvider::kHomepageIsNewTabPageRegistryValueName,
+ ConfigurationPolicyProviderWin::kHomepageIsNewTabPageRegistryValueName,
value));
}
-void TestWinConfigurationPolicyProvider::SetCookiesMode(
+void TestConfigurationPolicyProviderWin::SetCookiesMode(
HKEY hive,
uint32 value) {
RegKey key(hive,
- WinConfigurationPolicyProvider::kPolicyRegistrySubKey,
+ ConfigurationPolicyProviderWin::kPolicyRegistrySubKey,
KEY_ALL_ACCESS);
EXPECT_TRUE(key.WriteValue(
- WinConfigurationPolicyProvider::kCookiesModeRegistryValueName,
+ ConfigurationPolicyProviderWin::kCookiesModeRegistryValueName,
value));
}
@@ -85,9 +85,9 @@ void TestWinConfigurationPolicyProvider::SetCookiesMode(
// sandboxes, allowing the tests to manipulate and access policy as if it
// were active, but without actually changing the parts of the Registry that
// are managed by Group Policy.
-class WinConfigurationPolicyProviderTest : public testing::Test {
+class ConfigurationPolicyProviderWinTest : public testing::Test {
public:
- WinConfigurationPolicyProviderTest();
+ ConfigurationPolicyProviderWinTest();
// testing::Test method overrides:
virtual void SetUp();
@@ -106,12 +106,12 @@ class WinConfigurationPolicyProviderTest : public testing::Test {
RegKey temp_hklm_hive_key_;
};
-WinConfigurationPolicyProviderTest::WinConfigurationPolicyProviderTest()
+ConfigurationPolicyProviderWinTest::ConfigurationPolicyProviderWinTest()
: temp_hklm_hive_key_(HKEY_CURRENT_USER, kUnitTestMachineOverrideSubKey),
temp_hkcu_hive_key_(HKEY_CURRENT_USER, kUnitTestUserOverrideSubKey) {
}
-void WinConfigurationPolicyProviderTest::SetUp() {
+void ConfigurationPolicyProviderWinTest::SetUp() {
// Cleanup any remnants of previous tests.
DeleteRegistrySandbox();
@@ -127,7 +127,7 @@ void WinConfigurationPolicyProviderTest::SetUp() {
ActivateOverrides();
}
-void WinConfigurationPolicyProviderTest::ActivateOverrides() {
+void ConfigurationPolicyProviderWinTest::ActivateOverrides() {
HRESULT result = RegOverridePredefKey(HKEY_LOCAL_MACHINE,
temp_hklm_hive_key_.Handle());
EXPECT_EQ(ERROR_SUCCESS, result);
@@ -136,27 +136,27 @@ void WinConfigurationPolicyProviderTest::ActivateOverrides() {
EXPECT_EQ(ERROR_SUCCESS, result);
}
-void WinConfigurationPolicyProviderTest::DeactivateOverrides() {
+void ConfigurationPolicyProviderWinTest::DeactivateOverrides() {
uint32 result = RegOverridePredefKey(HKEY_LOCAL_MACHINE, 0);
EXPECT_EQ(ERROR_SUCCESS, result);
result = RegOverridePredefKey(HKEY_CURRENT_USER, 0);
EXPECT_EQ(ERROR_SUCCESS, result);
}
-void WinConfigurationPolicyProviderTest::TearDown() {
+void ConfigurationPolicyProviderWinTest::TearDown() {
DeactivateOverrides();
DeleteRegistrySandbox();
}
-void WinConfigurationPolicyProviderTest::DeleteRegistrySandbox() {
+void ConfigurationPolicyProviderWinTest::DeleteRegistrySandbox() {
temp_hklm_hive_key_.Close();
temp_hkcu_hive_key_.Close();
RegKey key(HKEY_CURRENT_USER, kUnitTestRegistrySubKey, KEY_ALL_ACCESS);
key.DeleteKey(L"");
}
-TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyDefault) {
+TEST_F(ConfigurationPolicyProviderWinTest, TestHomePagePolicyDefault) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.Provide(&store);
@@ -166,9 +166,9 @@ TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyDefault) {
EXPECT_TRUE(i == map.end());
}
-TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKCU) {
+TEST_F(ConfigurationPolicyProviderWinTest, TestHomePagePolicyHKCU) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.SetHomepageRegistryValue(HKEY_CURRENT_USER,
L"http://chromium.org");
@@ -183,9 +183,9 @@ TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKCU) {
EXPECT_EQ(L"http://chromium.org", value);
}
-TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKCUWrongType) {
+TEST_F(ConfigurationPolicyProviderWinTest, TestHomePagePolicyHKCUWrongType) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.SetHomepageRegistryValueWrongType(HKEY_CURRENT_USER);
provider.Provide(&store);
@@ -196,9 +196,9 @@ TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKCUWrongType) {
EXPECT_TRUE(i == map.end());
}
-TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKLM) {
+TEST_F(ConfigurationPolicyProviderWinTest, TestHomePagePolicyHKLM) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.SetHomepageRegistryValue(HKEY_LOCAL_MACHINE,
L"http://chromium.org");
@@ -213,9 +213,9 @@ TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKLM) {
EXPECT_EQ(L"http://chromium.org", value);
}
-TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKLMOverHKCU) {
+TEST_F(ConfigurationPolicyProviderWinTest, TestHomePagePolicyHKLMOverHKCU) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.SetHomepageRegistryValue(HKEY_CURRENT_USER,
L"http://chromium.org");
provider.SetHomepageRegistryValue(HKEY_LOCAL_MACHINE,
@@ -232,10 +232,10 @@ TEST_F(WinConfigurationPolicyProviderTest, TestHomePagePolicyHKLMOverHKCU) {
EXPECT_EQ(L"http://crbug.com", value);
}
-TEST_F(WinConfigurationPolicyProviderTest,
+TEST_F(ConfigurationPolicyProviderWinTest,
TestHomepageIsNewTabPagePolicyDefault) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.Provide(&store);
@@ -245,10 +245,10 @@ TEST_F(WinConfigurationPolicyProviderTest,
EXPECT_TRUE(i == map.end());
}
-TEST_F(WinConfigurationPolicyProviderTest,
+TEST_F(ConfigurationPolicyProviderWinTest,
TestHomepageIsNewTabPagePolicyHKLM) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.SetHomepageIsNewTabPage(HKEY_LOCAL_MACHINE, true);
provider.Provide(&store);
@@ -262,10 +262,10 @@ TEST_F(WinConfigurationPolicyProviderTest,
EXPECT_EQ(true, value);
}
-TEST_F(WinConfigurationPolicyProviderTest,
+TEST_F(ConfigurationPolicyProviderWinTest,
TestCookiesModePolicyDefault) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.Provide(&store);
@@ -275,10 +275,10 @@ TEST_F(WinConfigurationPolicyProviderTest,
EXPECT_TRUE(i == map.end());
}
-TEST_F(WinConfigurationPolicyProviderTest,
+TEST_F(ConfigurationPolicyProviderWinTest,
TestCookiesModePolicyHKLM) {
MockConfigurationPolicyStore store;
- TestWinConfigurationPolicyProvider provider;
+ TestConfigurationPolicyProviderWin provider;
provider.SetCookiesMode(HKEY_LOCAL_MACHINE, 2);
provider.Provide(&store);