| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) { | 165 if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) { |
| 166 *result = TRUE; | 166 *result = TRUE; |
| 167 return true; | 167 return true; |
| 168 } | 168 } |
| 169 | 169 |
| 170 *result = notification_callback.Run(parsed_command_line, current_directory) ? | 170 *result = notification_callback.Run(parsed_command_line, current_directory) ? |
| 171 TRUE : FALSE; | 171 TRUE : FALSE; |
| 172 return true; | 172 return true; |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Returns true if Chrome needs to be relaunched into Windows 8 immersive mode. | |
| 176 // Following conditions apply:- | |
| 177 // 1. Windows 8 or greater. | |
| 178 // 2. Not in Windows 8 immersive mode. | |
| 179 // 3. Chrome is default browser. | |
| 180 // 4. Process integrity level is not high. | |
| 181 // 5. The profile data directory is the default directory. | |
| 182 // 6. Last used mode was immersive/machine is a tablet. | |
| 183 // TODO(ananta) | |
| 184 // Move this function to a common place as the Windows 8 delegate_execute | |
| 185 // handler can possibly use this. | |
| 186 bool ShouldLaunchInWindows8ImmersiveMode(const base::FilePath& user_data_dir) { | |
| 187 // Returning false from this function doesn't mean we don't launch immersive | |
| 188 // mode in Aura. This function is specifically called in case when we need | |
| 189 // to relaunch desktop launched chrome into immersive mode through 'relaunch' | |
| 190 // menu. In case of Aura, we will use delegate_execute to do the relaunch. | |
| 191 return false; | |
| 192 } | |
| 193 | |
| 194 bool DisplayShouldKillMessageBox() { | 175 bool DisplayShouldKillMessageBox() { |
| 195 return chrome::ShowMessageBox( | 176 return chrome::ShowMessageBox( |
| 196 NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 177 NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 197 l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE), | 178 l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE), |
| 198 chrome::MESSAGE_BOX_TYPE_QUESTION) != | 179 chrome::MESSAGE_BOX_TYPE_QUESTION) != |
| 199 chrome::MESSAGE_BOX_RESULT_NO; | 180 chrome::MESSAGE_BOX_RESULT_NO; |
| 200 } | 181 } |
| 201 | 182 |
| 202 } // namespace | 183 } // namespace |
| 203 | 184 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 return window_.hwnd() != NULL; | 349 return window_.hwnd() != NULL; |
| 369 } | 350 } |
| 370 | 351 |
| 371 void ProcessSingleton::Cleanup() { | 352 void ProcessSingleton::Cleanup() { |
| 372 } | 353 } |
| 373 | 354 |
| 374 void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting( | 355 void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting( |
| 375 const ShouldKillRemoteProcessCallback& display_dialog_callback) { | 356 const ShouldKillRemoteProcessCallback& display_dialog_callback) { |
| 376 should_kill_remote_process_callback_ = display_dialog_callback; | 357 should_kill_remote_process_callback_ = display_dialog_callback; |
| 377 } | 358 } |
| OLD | NEW |