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

Unified Diff: app/win/window_impl.cc

Issue 2042003: Switch some Singletons to use LeakySingleton. Base URL: http://src.chromium.org/git/chromium.git
Patch Set: More build fixes. Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/win/window_impl.h ('k') | base/crypto/cssm_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/win/window_impl.cc
diff --git a/app/win/window_impl.cc b/app/win/window_impl.cc
index 9668f82ea88bd3157e29fc9b69a37129a5a274ee..e4b1f9ef4aeffd66399caec1d463b43925a2b99f 100644
--- a/app/win/window_impl.cc
+++ b/app/win/window_impl.cc
@@ -10,6 +10,15 @@
#include "base/string_util.h"
#include "base/win_util.h"
+namespace {
+
+// All classes registered by WidgetWin start with this name.
+// Several external scripts rely explicitly on this base class name for
+// acquiring the window handle and will break if this is modified!
+const wchar_t kBaseClassName[] = L"Chrome_WidgetWin_";
+
+} // namespace
+
namespace app {
static const DWORD kWindowDefaultChildStyle =
@@ -20,11 +29,6 @@ static const DWORD kWindowDefaultExStyle = 0;
///////////////////////////////////////////////////////////////////////////////
// WindowImpl class tracking.
-// Several external scripts rely explicitly on this base class name for
-// acquiring the window handle and will break if this is modified!
-// static
-const wchar_t* const WindowImpl::kBaseClassName = L"Chrome_WidgetWin_";
-
// WindowImpl class information used for registering unique windows.
struct ClassInfo {
UINT style;
@@ -61,7 +65,7 @@ class ClassRegistrar {
}
}
- name->assign(std::wstring(WindowImpl::kBaseClassName) +
+ name->assign(std::wstring(kBaseClassName) +
IntToWString(registered_count_++));
return false;
}
@@ -188,7 +192,8 @@ LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd,
std::wstring WindowImpl::GetWindowClassName() {
ClassInfo class_info(initial_class_style());
std::wstring name;
- if (Singleton<ClassRegistrar>()->RetrieveClassName(class_info, &name))
+ if (Singleton<ClassRegistrar, DefaultSingletonTraits<ClassRegistrar> >()->
+ RetrieveClassName(class_info, &name))
return name;
// No class found, need to register one.
« no previous file with comments | « app/win/window_impl.h ('k') | base/crypto/cssm_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698