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

Unified Diff: content/browser/system_message_window_win.cc

Issue 8528044: Revert 109960 - Send WM_DEVICECHANGE message through SystemMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « content/browser/system_message_window_win.h ('k') | content/common/hi_res_timer_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/system_message_window_win.cc
===================================================================
--- content/browser/system_message_window_win.cc (revision 109978)
+++ content/browser/system_message_window_win.cc (working copy)
@@ -1,57 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/system_message_window_win.h"
-
-#include <windows.h>
-#include <dbt.h>
-
-#include "base/system_monitor/system_monitor.h"
-#include "base/win/wrapped_window_proc.h"
-
-static const wchar_t* const WindowClassName = L"Chrome_SystemMessageWindow";
-
-SystemMessageWindowWin::SystemMessageWindowWin() {
- HINSTANCE hinst = GetModuleHandle(NULL);
-
- WNDCLASSEX wc = {0};
- wc.cbSize = sizeof(wc);
- wc.lpfnWndProc =
- base::win::WrappedWindowProc<&SystemMessageWindowWin::WndProcThunk>;
- wc.hInstance = hinst;
- wc.lpszClassName = WindowClassName;
- ATOM clazz = RegisterClassEx(&wc);
- DCHECK(clazz);
-
- window_ = CreateWindow(WindowClassName,
- 0, 0, 0, 0, 0, 0, 0, 0, hinst, 0);
- SetWindowLongPtr(window_, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
-}
-
-SystemMessageWindowWin::~SystemMessageWindowWin() {
- if (window_) {
- DestroyWindow(window_);
- UnregisterClass(WindowClassName, GetModuleHandle(NULL));
- }
-}
-
-LRESULT SystemMessageWindowWin::OnDeviceChange(UINT event_type, DWORD data) {
- base::SystemMonitor* monitor = base::SystemMonitor::Get();
- if (monitor && event_type == DBT_DEVNODES_CHANGED)
- monitor->ProcessDevicesChanged();
- return TRUE;
-}
-
-LRESULT CALLBACK SystemMessageWindowWin::WndProc(HWND hwnd, UINT message,
- WPARAM wparam, LPARAM lparam) {
- switch (message) {
- case WM_DEVICECHANGE:
- return OnDeviceChange(static_cast<UINT>(wparam),
- static_cast<DWORD>(lparam));
- default:
- break;
- }
-
- return ::DefWindowProc(hwnd, message, wparam, lparam);
-}
« no previous file with comments | « content/browser/system_message_window_win.h ('k') | content/common/hi_res_timer_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698