summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 07:01:34 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 07:01:34 +0000
commit1faee3f0c048f4e8f7cb165497376ec09e3155e1 (patch)
treee4dfc755184d2a9382a7836df636994a875f97bd
parentf66333c798f7b252477fae4ef8827dc2cba7dbce (diff)
downloadchromium_src-1faee3f0c048f4e8f7cb165497376ec09e3155e1.zip
chromium_src-1faee3f0c048f4e8f7cb165497376ec09e3155e1.tar.gz
chromium_src-1faee3f0c048f4e8f7cb165497376ec09e3155e1.tar.bz2
Rename ThemeResourcesUtil to ResourcesUtil.
I'll be adding a map of FilePath to resource id to this class soon. For example, FilePath("bookmark_manager/main.html") -> id. Review URL: http://codereview.chromium.org/2870001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50336 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_theme_pack_unittest.cc1
-rw-r--r--chrome/browser/dom_ui/dom_ui_theme_source.cc6
-rw-r--r--chrome/browser/resources_util.cc (renamed from chrome/browser/theme_resources_util.cc)4
-rw-r--r--chrome/browser/resources_util.h (renamed from chrome/browser/theme_resources_util.h)8
-rw-r--r--chrome/browser/resources_util_unittest.cc (renamed from chrome/browser/theme_resources_util_unittest.cc)11
-rw-r--r--chrome/browser/views/autofill_profiles_view_win.cc1
-rwxr-xr-xchrome/chrome_browser.gypi4
-rwxr-xr-xchrome/chrome_tests.gypi2
8 files changed, 18 insertions, 19 deletions
diff --git a/chrome/browser/browser_theme_pack_unittest.cc b/chrome/browser/browser_theme_pack_unittest.cc
index 0b7912f..001476c 100644
--- a/chrome/browser/browser_theme_pack_unittest.cc
+++ b/chrome/browser/browser_theme_pack_unittest.cc
@@ -11,7 +11,6 @@
#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
#include "base/values.h"
-#include "chrome/browser/theme_resources_util.h"
#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/common/chrome_paths.h"
diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc
index 9a33a12..f34091e 100644
--- a/chrome/browser/dom_ui/dom_ui_theme_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_ui/ntp_resource_cache.h"
#include "chrome/browser/profile.h"
-#include "chrome/browser/theme_resources_util.h"
+#include "chrome/browser/resources_util.h"
#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
@@ -50,7 +50,7 @@ void DOMUIThemeSource::StartDataRequest(const std::string& path,
SendResponse(request_id, css_bytes_);
return;
} else {
- int resource_id = ThemeResourcesUtil::GetId(uncached_path);
+ int resource_id = ResourcesUtil::GetThemeResourceId(uncached_path);
if (resource_id != -1) {
SendThemeBitmap(request_id, resource_id);
return;
@@ -83,7 +83,7 @@ MessageLoop* DOMUIThemeSource::MessageLoopForRequestPath(
}
// If it's not a themeable image, we don't need to go to the UI thread.
- int resource_id = ThemeResourcesUtil::GetId(uncached_path);
+ int resource_id = ResourcesUtil::GetThemeResourceId(uncached_path);
if (!BrowserThemeProvider::IsThemeableImage(resource_id))
return NULL;
diff --git a/chrome/browser/theme_resources_util.cc b/chrome/browser/resources_util.cc
index 2358f6f..aefc4e3 100644
--- a/chrome/browser/theme_resources_util.cc
+++ b/chrome/browser/resources_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/theme_resources_util.h"
+#include "chrome/browser/resources_util.h"
#include "base/hash_tables.h"
#include "base/lazy_instance.h"
@@ -41,6 +41,6 @@ static base::LazyInstance<ThemeMap> g_theme_ids(base::LINKER_INITIALIZED);
} // namespace
-int ThemeResourcesUtil::GetId(const std::string& resource_name) {
+int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) {
return g_theme_ids.Get().GetId(resource_name);
}
diff --git a/chrome/browser/theme_resources_util.h b/chrome/browser/resources_util.h
index 6509a50..c1400d7 100644
--- a/chrome/browser/theme_resources_util.h
+++ b/chrome/browser/resources_util.h
@@ -9,14 +9,14 @@
#include "base/basictypes.h"
-class ThemeResourcesUtil {
+class ResourcesUtil {
public:
// Returns the theme resource id or -1 if no resource with the name exists.
- static int GetId(const std::string& resource_name);
+ static int GetThemeResourceId(const std::string& resource_name);
private:
- ThemeResourcesUtil() {}
- DISALLOW_COPY_AND_ASSIGN(ThemeResourcesUtil);
+ ResourcesUtil() {}
+ DISALLOW_COPY_AND_ASSIGN(ResourcesUtil);
};
#endif // CHROME_BROWSER_THEME_RESOURCES_UTIL_H_
diff --git a/chrome/browser/theme_resources_util_unittest.cc b/chrome/browser/resources_util_unittest.cc
index 84e9395..caa21ba 100644
--- a/chrome/browser/theme_resources_util_unittest.cc
+++ b/chrome/browser/resources_util_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/theme_resources_util.h"
+#include "chrome/browser/resources_util.h"
#include "grit/theme_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -16,7 +16,7 @@ struct TestCase {
} // namespace
-TEST(ThemeResourcesUtil, SpotCheckIds) {
+TEST(ResourcesUtil, SpotCheckIds) {
const TestCase kTestCases[] = {
{"back", IDR_BACK},
{"stop", IDR_STOP},
@@ -24,10 +24,11 @@ TEST(ThemeResourcesUtil, SpotCheckIds) {
{"sad_tab", IDR_SAD_TAB},
};
for (size_t i = 0; i < arraysize(kTestCases); ++i) {
- EXPECT_EQ(kTestCases[i].id, ThemeResourcesUtil::GetId(kTestCases[i].name));
+ EXPECT_EQ(kTestCases[i].id,
+ ResourcesUtil::GetThemeResourceId(kTestCases[i].name));
}
// Should return -1 of unknown names.
- EXPECT_EQ(-1, ThemeResourcesUtil::GetId("foobar"));
- EXPECT_EQ(-1, ThemeResourcesUtil::GetId("backstar"));
+ EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("foobar"));
+ EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("backstar"));
}
diff --git a/chrome/browser/views/autofill_profiles_view_win.cc b/chrome/browser/views/autofill_profiles_view_win.cc
index 4e7e79e..9d78092 100644
--- a/chrome/browser/views/autofill_profiles_view_win.cc
+++ b/chrome/browser/views/autofill_profiles_view_win.cc
@@ -18,7 +18,6 @@
#include "chrome/browser/browser_window.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
-#include "chrome/browser/theme_resources_util.h"
#include "chrome/browser/views/list_background.h"
#include "chrome/browser/window_sizer.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index a5f6a24..44d9d8f 100755
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2011,6 +2011,8 @@
'browser/renderer_preferences_util.h',
'browser/repost_form_warning_controller.cc',
'browser/repost_form_warning_controller.h',
+ 'browser/resources_util.cc',
+ 'browser/resources_util.h',
'browser/rlz/rlz.cc',
'browser/rlz/rlz.h',
'browser/safe_browsing/bloom_filter.cc',
@@ -2271,8 +2273,6 @@
'browser/task_manager.h',
'browser/task_manager_resource_providers.cc',
'browser/task_manager_resource_providers.h',
- 'browser/theme_resources_util.cc',
- 'browser/theme_resources_util.h',
'browser/thumbnail_store.cc',
'browser/thumbnail_store.h',
'browser/toolbar_model.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 46a855d..713f990 100755
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -891,6 +891,7 @@
'browser/renderer_host/test/render_view_host_unittest.cc',
'browser/renderer_host/test/site_instance_unittest.cc',
'browser/renderer_host/web_cache_manager_unittest.cc',
+ 'browser/resources_util_unittest.cc',
'browser/rlz/rlz_unittest.cc',
'browser/safe_browsing/bloom_filter_unittest.cc',
'browser/safe_browsing/chunk_range_unittest.cc',
@@ -964,7 +965,6 @@
'browser/tabs/pinned_tab_codec_unittest.cc',
'browser/tabs/tab_strip_model_unittest.cc',
'browser/task_manager_unittest.cc',
- 'browser/theme_resources_util_unittest.cc',
'browser/thumbnail_store_unittest.cc',
'browser/translate/translate_manager_unittest.cc',
'browser/translate/translate_manager2_unittest.cc',