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

Unified Diff: ui/base/win/window_impl.cc

Issue 11364202: Get full WebPluginInfo for the PDF plug-in before enabling it for print preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix? Created 8 years, 1 month 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 | « chrome/test/base/browser_with_test_window_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/window_impl.cc
diff --git a/ui/base/win/window_impl.cc b/ui/base/win/window_impl.cc
index dce0f2f7b6341723c1690a7ab69e9c02ef587830..580721a50f8e179c0c0bae87227835a2cbed98d0 100644
--- a/ui/base/win/window_impl.cc
+++ b/ui/base/win/window_impl.cc
@@ -45,17 +45,11 @@ struct ClassInfo {
class ClassRegistrar {
public:
static ClassRegistrar* GetInstance() {
- return Singleton<ClassRegistrar>::get();
+ return Singleton<ClassRegistrar,
+ LeakySingletonTraits<ClassRegistrar> >::get();
}
~ClassRegistrar() {
- for (RegisteredClasses::iterator i = registered_classes_.begin();
- i != registered_classes_.end(); ++i) {
- if (!UnregisterClass(MAKEINTATOM(i->atom), i->instance)) {
- LOG(ERROR) << "Failed to unregister class " << i->name.c_str()
- << ". Error = " << GetLastError();
- }
- }
}
// Puts the name for the class matching |class_info| in |class_name|, creating
@@ -76,24 +70,17 @@ class ClassRegistrar {
}
void RegisterClass(const ClassInfo& class_info,
- const std::wstring& name,
- ATOM atom,
- HMODULE instance) {
- registered_classes_.push_back(
- RegisteredClass(class_info, name, atom, instance));
+ const std::wstring& name) {
+ registered_classes_.push_back(RegisteredClass(class_info, name));
}
private:
// Represents a registered window class.
struct RegisteredClass {
RegisteredClass(const ClassInfo& info,
- const std::wstring& name,
- ATOM atom,
- HMODULE instance)
+ const std::wstring& name)
: info(info),
- name(name),
- atom(atom),
- instance(instance) {
+ name(name) {
}
// Info used to create the class.
@@ -101,12 +88,6 @@ class ClassRegistrar {
// The name given to the window class.
std::wstring name;
-
- // The ATOM returned from registering the window class.
- ATOM atom;
-
- // The handle of the module containing the window procedure.
- HMODULE instance;
};
ClassRegistrar() : registered_count_(0) { }
@@ -269,8 +250,7 @@ std::wstring WindowImpl::GetWindowClassName() {
ATOM atom = RegisterClassEx(&window_class);
CHECK(atom) << GetLastError();
- ClassRegistrar::GetInstance()->RegisterClass(
- class_info, name, atom, instance);
+ ClassRegistrar::GetInstance()->RegisterClass(class_info, name);
return name;
}
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698