| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE)); | 148 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE)); |
| 149 std::wstring caption = | 149 std::wstring caption = |
| 150 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 150 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 151 if (!platform_util::SimpleYesNoBox(NULL, caption, text)) { | 151 if (!platform_util::SimpleYesNoBox(NULL, caption, text)) { |
| 152 // The user denied. Quit silently. | 152 // The user denied. Quit silently. |
| 153 return PROCESS_NOTIFIED; | 153 return PROCESS_NOTIFIED; |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Time to take action. Kill the browser process. | 157 // Time to take action. Kill the browser process. |
| 158 base::KillProcessById(process_id, ResultCodes::HUNG, true); | 158 base::KillProcessById(process_id, content::RESULT_CODE_HUNG, true); |
| 159 remote_window_ = NULL; | 159 remote_window_ = NULL; |
| 160 return PROCESS_NONE; | 160 return PROCESS_NONE; |
| 161 } | 161 } |
| 162 | 162 |
| 163 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { | 163 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { |
| 164 NotifyResult result = NotifyOtherProcess(); | 164 NotifyResult result = NotifyOtherProcess(); |
| 165 if (result != PROCESS_NONE) | 165 if (result != PROCESS_NONE) |
| 166 return result; | 166 return result; |
| 167 return Create() ? PROCESS_NONE : PROFILE_IN_USE; | 167 return Create() ? PROCESS_NONE : PROFILE_IN_USE; |
| 168 } | 168 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 switch (message) { | 305 switch (message) { |
| 306 case WM_COPYDATA: | 306 case WM_COPYDATA: |
| 307 return OnCopyData(reinterpret_cast<HWND>(wparam), | 307 return OnCopyData(reinterpret_cast<HWND>(wparam), |
| 308 reinterpret_cast<COPYDATASTRUCT*>(lparam)); | 308 reinterpret_cast<COPYDATASTRUCT*>(lparam)); |
| 309 default: | 309 default: |
| 310 break; | 310 break; |
| 311 } | 311 } |
| 312 | 312 |
| 313 return ::DefWindowProc(hwnd, message, wparam, lparam); | 313 return ::DefWindowProc(hwnd, message, wparam, lparam); |
| 314 } | 314 } |
| OLD | NEW |