| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/win_util.h" | 8 #include "app/win_util.h" |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 win_util::SetWindowUserData(window_, this); | 194 win_util::SetWindowUserData(window_, this); |
| 195 return true; | 195 return true; |
| 196 } | 196 } |
| 197 | 197 |
| 198 void ProcessSingleton::Cleanup() { | 198 void ProcessSingleton::Cleanup() { |
| 199 } | 199 } |
| 200 | 200 |
| 201 LRESULT ProcessSingleton::OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds) { | 201 LRESULT ProcessSingleton::OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds) { |
| 202 // If locked, it means we are not ready to process this message because | 202 // If locked, it means we are not ready to process this message because |
| 203 // we are probably in a first run critical phase. We must do this before | 203 // we are probably in a first run critical phase. |
| 204 // doing the IsShuttingDown() check since that returns true during first run | |
| 205 // (since g_browser_process hasn't been AddRefModule()d yet). | |
| 206 if (locked_) { | 204 if (locked_) { |
| 207 // Attempt to place ourselves in the foreground / flash the task bar. | 205 // Attempt to place ourselves in the foreground / flash the task bar. |
| 208 if (IsWindow(foreground_window_)) | 206 if (IsWindow(foreground_window_)) |
| 209 SetForegroundWindow(foreground_window_); | 207 SetForegroundWindow(foreground_window_); |
| 210 return TRUE; | 208 return TRUE; |
| 211 } | 209 } |
| 212 | 210 |
| 213 // Ignore the request if the browser process is already in shutdown path. | 211 // Ignore the request if the browser process is already in shutdown path. |
| 214 if (!g_browser_process || g_browser_process->IsShuttingDown()) { | 212 if (!g_browser_process || g_browser_process->IsShuttingDown()) { |
| 215 LOG(WARNING) << "Not handling WM_COPYDATA as browser is shutting down"; | 213 LOG(WARNING) << "Not handling WM_COPYDATA as browser is shutting down"; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 switch (message) { | 292 switch (message) { |
| 295 case WM_COPYDATA: | 293 case WM_COPYDATA: |
| 296 return OnCopyData(reinterpret_cast<HWND>(wparam), | 294 return OnCopyData(reinterpret_cast<HWND>(wparam), |
| 297 reinterpret_cast<COPYDATASTRUCT*>(lparam)); | 295 reinterpret_cast<COPYDATASTRUCT*>(lparam)); |
| 298 default: | 296 default: |
| 299 break; | 297 break; |
| 300 } | 298 } |
| 301 | 299 |
| 302 return ::DefWindowProc(hwnd, message, wparam, lparam); | 300 return ::DefWindowProc(hwnd, message, wparam, lparam); |
| 303 } | 301 } |
| OLD | NEW |