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 | 8 |
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 20 matching lines...) Expand all Loading... |
31 #include "chrome/common/chrome_paths_internal.h" | 31 #include "chrome/common/chrome_paths_internal.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/installer/util/wmi.h" | 33 #include "chrome/installer/util/wmi.h" |
34 #include "content/public/common/result_codes.h" | 34 #include "content/public/common/result_codes.h" |
35 #include "grit/chromium_strings.h" | 35 #include "grit/chromium_strings.h" |
36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
37 #include "net/base/escape.h" | 37 #include "net/base/escape.h" |
38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
39 #include "ui/base/win/hwnd_util.h" | 39 #include "ui/base/win/hwnd_util.h" |
40 | 40 |
| 41 #if defined(USE_AURA) |
| 42 #include "chrome/browser/browser_process_platform_part_aurawin.h" |
| 43 #else |
| 44 #include "chrome/browser/browser_process_platform_part.h" |
| 45 #endif |
| 46 |
41 namespace { | 47 namespace { |
42 | 48 |
43 const char kLockfile[] = "lockfile"; | 49 const char kLockfile[] = "lockfile"; |
44 | 50 |
45 const char kSearchUrl[] = | 51 const char kSearchUrl[] = |
46 "http://www.google.com/search?q=%s&sourceid=chrome&ie=UTF-8"; | 52 "http://www.google.com/search?q=%s&sourceid=chrome&ie=UTF-8"; |
47 | 53 |
48 const int kMetroChromeActivationTimeoutMs = 3000; | 54 const int kMetroChromeActivationTimeoutMs = 3000; |
49 | 55 |
50 // A helper class that acquires the given |mutex| while the AutoLockMutex is in | 56 // A helper class that acquires the given |mutex| while the AutoLockMutex is in |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return PROCESS_NONE; | 405 return PROCESS_NONE; |
400 } | 406 } |
401 | 407 |
402 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { | 408 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { |
403 ProcessSingleton::NotifyResult result = PROCESS_NONE; | 409 ProcessSingleton::NotifyResult result = PROCESS_NONE; |
404 if (!Create()) { | 410 if (!Create()) { |
405 result = NotifyOtherProcess(); | 411 result = NotifyOtherProcess(); |
406 if (result == PROCESS_NONE) | 412 if (result == PROCESS_NONE) |
407 result = PROFILE_IN_USE; | 413 result = PROFILE_IN_USE; |
408 } else { | 414 } else { |
409 g_browser_process->PlatformSpecificCommandLineProcessing( | 415 g_browser_process->platform_part()->PlatformSpecificCommandLineProcessing( |
410 *CommandLine::ForCurrentProcess()); | 416 *CommandLine::ForCurrentProcess()); |
411 } | 417 } |
412 return result; | 418 return result; |
413 } | 419 } |
414 | 420 |
415 // Look for a Chrome instance that uses the same profile directory. If there | 421 // Look for a Chrome instance that uses the same profile directory. If there |
416 // isn't one, create a message window with its title set to the profile | 422 // isn't one, create a message window with its title set to the profile |
417 // directory path. | 423 // directory path. |
418 bool ProcessSingleton::Create() { | 424 bool ProcessSingleton::Create() { |
419 static const wchar_t kMutexName[] = L"Local\\ChromeProcessSingletonStartup!"; | 425 static const wchar_t kMutexName[] = L"Local\\ChromeProcessSingletonStartup!"; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 switch (message) { | 569 switch (message) { |
564 case WM_COPYDATA: | 570 case WM_COPYDATA: |
565 return OnCopyData(reinterpret_cast<HWND>(wparam), | 571 return OnCopyData(reinterpret_cast<HWND>(wparam), |
566 reinterpret_cast<COPYDATASTRUCT*>(lparam)); | 572 reinterpret_cast<COPYDATASTRUCT*>(lparam)); |
567 default: | 573 default: |
568 break; | 574 break; |
569 } | 575 } |
570 | 576 |
571 return ::DefWindowProc(hwnd, message, wparam, lparam); | 577 return ::DefWindowProc(hwnd, message, wparam, lparam); |
572 } | 578 } |
OLD | NEW |