| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) + | 45 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) + |
| 46 L"=\"" + profile.ToWStringHack() + L"\" "; | 46 L"=\"" + profile.ToWStringHack() + L"\" "; |
| 47 } | 47 } |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 // If |extension_app_id| is present, we use the kAppId switch rather than | 50 // If |extension_app_id| is present, we use the kAppId switch rather than |
| 51 // the kApp switch (the launch url will be read from the extension app | 51 // the kApp switch (the launch url will be read from the extension app |
| 52 // during launch. | 52 // during launch. |
| 53 if (!extension_app_id.empty()) { | 53 if (!extension_app_id.empty()) { |
| 54 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kAppId) + | 54 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kAppId) + |
| 55 L"=\"" + ASCIIToWide(UTF16ToASCII(extension_app_id)); | 55 L"=\"" + ASCIIToWide(UTF16ToASCII(extension_app_id)) + L"\""; |
| 56 } else { | 56 } else { |
| 57 // Use '--app=url' instead of just 'url' to launch the browser with minimal | 57 // Use '--app=url' instead of just 'url' to launch the browser with minimal |
| 58 // chrome. | 58 // chrome. |
| 59 // Note: Do not change this flag! Old Gears shortcuts will break if you do! | 59 // Note: Do not change this flag! Old Gears shortcuts will break if you do! |
| 60 std::string url_string = url.spec(); | 60 std::string url_string = url.spec(); |
| 61 ReplaceSubstringsAfterOffset(&url_string, 0, "\\", "%5C"); | 61 ReplaceSubstringsAfterOffset(&url_string, 0, "\\", "%5C"); |
| 62 ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "%22"); | 62 ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "%22"); |
| 63 ReplaceSubstringsAfterOffset(&url_string, 0, ";", "%3B"); | 63 ReplaceSubstringsAfterOffset(&url_string, 0, ";", "%3B"); |
| 64 ReplaceSubstringsAfterOffset(&url_string, 0, "$", "%24"); | 64 ReplaceSubstringsAfterOffset(&url_string, 0, "$", "%24"); |
| 65 #if defined(OS_WIN) // Windows shortcuts can't escape % so we use \x instead. | 65 #if defined(OS_WIN) // Windows shortcuts can't escape % so we use \x instead. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 observer_->SetDefaultBrowserUIState(STATE_IS_DEFAULT); | 149 observer_->SetDefaultBrowserUIState(STATE_IS_DEFAULT); |
| 150 break; | 150 break; |
| 151 case UNKNOWN_DEFAULT_BROWSER: | 151 case UNKNOWN_DEFAULT_BROWSER: |
| 152 observer_->SetDefaultBrowserUIState(STATE_UNKNOWN); | 152 observer_->SetDefaultBrowserUIState(STATE_UNKNOWN); |
| 153 break; | 153 break; |
| 154 default: | 154 default: |
| 155 break; | 155 break; |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 } | 158 } |
| OLD | NEW |