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

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

Issue 5273004: Add "create Application Shortcut" to the app menu on NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for commit. Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/browser/ui/browser.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698