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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 extern int NaClMain(const content::MainFunctionParams&); | 146 extern int NaClMain(const content::MainFunctionParams&); |
147 extern int ServiceProcessMain(const content::MainFunctionParams&); | 147 extern int ServiceProcessMain(const content::MainFunctionParams&); |
148 | 148 |
149 namespace { | 149 namespace { |
150 | 150 |
151 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
152 // Early versions of Chrome incorrectly registered a chromehtml: URL handler, | 152 // Early versions of Chrome incorrectly registered a chromehtml: URL handler, |
153 // which gives us nothing but trouble. Avoid launching chrome this way since | 153 // which gives us nothing but trouble. Avoid launching chrome this way since |
154 // some apps fail to properly escape arguments. | 154 // some apps fail to properly escape arguments. |
155 bool HasDeprecatedArguments(const std::wstring& command_line) { | 155 bool HasDeprecatedArguments(const base::string16& command_line) { |
156 const wchar_t kChromeHtml[] = L"chromehtml:"; | 156 const wchar_t kChromeHtml[] = L"chromehtml:"; |
157 std::wstring command_line_lower = command_line; | 157 base::string16 command_line_lower = base::ToLowerASCII(command_line); |
158 // We are only searching for ASCII characters so this is OK. | 158 // We are only searching for ASCII characters so this is OK. |
159 base::StringToLowerASCII(&command_line_lower); | 159 return (command_line_lower.find(kChromeHtml) != base::string16::npos); |
160 std::wstring::size_type pos = command_line_lower.find(kChromeHtml); | |
161 return (pos != std::wstring::npos); | |
162 } | 160 } |
163 | 161 |
164 // If we try to access a path that is not currently available, we want the call | 162 // If we try to access a path that is not currently available, we want the call |
165 // to fail rather than show an error dialog. | 163 // to fail rather than show an error dialog. |
166 void SuppressWindowsErrorDialogs() { | 164 void SuppressWindowsErrorDialogs() { |
167 UINT new_flags = SEM_FAILCRITICALERRORS | | 165 UINT new_flags = SEM_FAILCRITICALERRORS | |
168 SEM_NOOPENFILEERRORBOX; | 166 SEM_NOOPENFILEERRORBOX; |
169 | 167 |
170 // Preserve existing error mode. | 168 // Preserve existing error mode. |
171 UINT existing_flags = SetErrorMode(new_flags); | 169 UINT existing_flags = SetErrorMode(new_flags); |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 case version_info::Channel::CANARY: | 972 case version_info::Channel::CANARY: |
975 return true; | 973 return true; |
976 case version_info::Channel::DEV: | 974 case version_info::Channel::DEV: |
977 case version_info::Channel::BETA: | 975 case version_info::Channel::BETA: |
978 case version_info::Channel::STABLE: | 976 case version_info::Channel::STABLE: |
979 default: | 977 default: |
980 // Don't enable instrumentation. | 978 // Don't enable instrumentation. |
981 return false; | 979 return false; |
982 } | 980 } |
983 } | 981 } |
OLD | NEW |