Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: chrome/browser/shell_integration.cc

Issue 3522015: Implement new strategy for default apps (Closed)
Patch Set: all done Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/browser/utility_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 24 matching lines...) Expand all
35 FilePath profile = cmd.GetSwitchValuePath(switches::kLoginProfile); 35 FilePath profile = cmd.GetSwitchValuePath(switches::kLoginProfile);
36 if (!profile.empty()) { 36 if (!profile.empty()) {
37 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) + 37 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) +
38 L"=\"" + profile.ToWStringHack() + L"\" "; 38 L"=\"" + profile.ToWStringHack() + L"\" ";
39 } 39 }
40 #endif 40 #endif
41 41
42 // If |extension_app_id| is present, we use the kAppId switch rather than 42 // If |extension_app_id| is present, we use the kAppId switch rather than
43 // the kApp switch (the launch url will be read from the extension app 43 // the kApp switch (the launch url will be read from the extension app
44 // during launch. 44 // during launch.
45 if (!cmd.HasSwitch(switches::kDisableApps) && !extension_app_id.empty()) { 45 if (!extension_app_id.empty()) {
46 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kAppId) + 46 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kAppId) +
47 L"=\"" + ASCIIToWide(UTF16ToASCII(extension_app_id)); 47 L"=\"" + ASCIIToWide(UTF16ToASCII(extension_app_id));
48 } else { 48 } else {
49 // Use '--app=url' instead of just 'url' to launch the browser with minimal 49 // Use '--app=url' instead of just 'url' to launch the browser with minimal
50 // chrome. 50 // chrome.
51 // Note: Do not change this flag! Old Gears shortcuts will break if you do! 51 // Note: Do not change this flag! Old Gears shortcuts will break if you do!
52 std::string url_string = url.spec(); 52 std::string url_string = url.spec();
53 ReplaceSubstringsAfterOffset(&url_string, 0, "\\", "%5C"); 53 ReplaceSubstringsAfterOffset(&url_string, 0, "\\", "%5C");
54 ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "%22"); 54 ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "%22");
55 ReplaceSubstringsAfterOffset(&url_string, 0, ";", "%3B"); 55 ReplaceSubstringsAfterOffset(&url_string, 0, ";", "%3B");
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 observer_->SetDefaultBrowserUIState(STATE_IS_DEFAULT); 141 observer_->SetDefaultBrowserUIState(STATE_IS_DEFAULT);
142 break; 142 break;
143 case UNKNOWN_DEFAULT_BROWSER: 143 case UNKNOWN_DEFAULT_BROWSER:
144 observer_->SetDefaultBrowserUIState(STATE_UNKNOWN); 144 observer_->SetDefaultBrowserUIState(STATE_UNKNOWN);
145 break; 145 break;
146 default: 146 default:
147 break; 147 break;
148 } 148 }
149 } 149 }
150 } 150 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/browser/utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698