| 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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.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/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 namespace { | 138 namespace { |
| 139 | 139 |
| 140 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
| 141 // Early versions of Chrome incorrectly registered a chromehtml: URL handler, | 141 // Early versions of Chrome incorrectly registered a chromehtml: URL handler, |
| 142 // which gives us nothing but trouble. Avoid launching chrome this way since | 142 // which gives us nothing but trouble. Avoid launching chrome this way since |
| 143 // some apps fail to properly escape arguments. | 143 // some apps fail to properly escape arguments. |
| 144 bool HasDeprecatedArguments(const std::wstring& command_line) { | 144 bool HasDeprecatedArguments(const std::wstring& command_line) { |
| 145 const wchar_t kChromeHtml[] = L"chromehtml:"; | 145 const wchar_t kChromeHtml[] = L"chromehtml:"; |
| 146 std::wstring command_line_lower = command_line; | 146 std::wstring command_line_lower = command_line; |
| 147 // We are only searching for ASCII characters so this is OK. | 147 // We are only searching for ASCII characters so this is OK. |
| 148 StringToLowerASCII(&command_line_lower); | 148 base::StringToLowerASCII(&command_line_lower); |
| 149 std::wstring::size_type pos = command_line_lower.find(kChromeHtml); | 149 std::wstring::size_type pos = command_line_lower.find(kChromeHtml); |
| 150 return (pos != std::wstring::npos); | 150 return (pos != std::wstring::npos); |
| 151 } | 151 } |
| 152 | 152 |
| 153 // If we try to access a path that is not currently available, we want the call | 153 // If we try to access a path that is not currently available, we want the call |
| 154 // to fail rather than show an error dialog. | 154 // to fail rather than show an error dialog. |
| 155 void SuppressWindowsErrorDialogs() { | 155 void SuppressWindowsErrorDialogs() { |
| 156 UINT new_flags = SEM_FAILCRITICALERRORS | | 156 UINT new_flags = SEM_FAILCRITICALERRORS | |
| 157 SEM_NOOPENFILEERRORBOX; | 157 SEM_NOOPENFILEERRORBOX; |
| 158 | 158 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 } | 928 } |
| 929 | 929 |
| 930 content::ContentUtilityClient* | 930 content::ContentUtilityClient* |
| 931 ChromeMainDelegate::CreateContentUtilityClient() { | 931 ChromeMainDelegate::CreateContentUtilityClient() { |
| 932 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 932 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 933 return NULL; | 933 return NULL; |
| 934 #else | 934 #else |
| 935 return g_chrome_content_utility_client.Pointer(); | 935 return g_chrome_content_utility_client.Pointer(); |
| 936 #endif | 936 #endif |
| 937 } | 937 } |
| OLD | NEW |