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

Side by Side Diff: chrome/installer/util/shell_util.h

Issue 10512026: Fix RegisterChromeBrowser definition and usage in shell_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better comment Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/installer/util/shell_util.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) 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 // This file declares methods that are useful for integrating Chrome in 5 // This file declares methods that are useful for integrating Chrome in
6 // Windows shell. These methods are all static and currently part of 6 // Windows shell. These methods are all static and currently part of
7 // ShellUtil class. 7 // ShellUtil class.
8 8
9 #ifndef CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ 9 #ifndef CHROME_INSTALLER_UTIL_SHELL_UTIL_H_
10 #define CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ 10 #define CHROME_INSTALLER_UTIL_SHELL_UTIL_H_
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 static bool ShowMakeChromeDefaultSystemUI(BrowserDistribution* dist, 246 static bool ShowMakeChromeDefaultSystemUI(BrowserDistribution* dist,
247 const string16& chrome_exe); 247 const string16& chrome_exe);
248 248
249 // Make Chrome the default application for a protocol. 249 // Make Chrome the default application for a protocol.
250 // chrome_exe: The chrome.exe path to register as default browser. 250 // chrome_exe: The chrome.exe path to register as default browser.
251 // protocol: The protocol to register as the default handler for. 251 // protocol: The protocol to register as the default handler for.
252 static bool MakeChromeDefaultProtocolClient(BrowserDistribution* dist, 252 static bool MakeChromeDefaultProtocolClient(BrowserDistribution* dist,
253 const string16& chrome_exe, 253 const string16& chrome_exe,
254 const string16& protocol); 254 const string16& protocol);
255 255
256 // This method adds Chrome to the list that shows up in Add/Remove Programs-> 256 // Registers Chrome as a potential default browser and handler for filetypes
257 // Set Program Access and Defaults and also creates Chrome ProgIds under 257 // and protocols.
258 // Software\Classes. This method requires write access to HKLM so is just 258 // If Chrome is already registered, this method is a no-op.
259 // best effort deal. If write to HKLM fails and elevate_if_not_admin is true, 259 // This method requires write access to HKLM so is just a best effort deal.
260 // this method will: 260 // If write to HKLM fails and:
261 // - add the ProgId entries to HKCU on XP. HKCU entries will not make 261 // - |elevate_if_not_admin| is true (and OS is Vista or above):
262 // Chrome show in Set Program Access and Defaults but they are still useful 262 // tries to launch setup.exe with admin priviledges (by prompting the user
263 // because we can make Chrome run when user clicks on http link or html 263 // with a UAC) to do these tasks.
264 // file. 264 // - |elevate_if_not_admin| is false (or OS is XP):
265 // - will try to launch setup.exe with admin priviledges on Vista to do 265 // adds the ProgId entries to HKCU. These entries will not make Chrome show
266 // these tasks. Users will see standard Vista elevation prompt and if they 266 // in Default Programs but they are still useful because Chrome can be
267 // enter the right credentials, the write operation will work. 267 // registered to run when the user clicks on an http link or an html file.
grt (UTC plus 2) 2012/06/11 17:57:38 nit: "when the" -> "when the"
gab 2012/06/11 19:38:11 Done.
268 // Currently elevate_if_not_admin is true only when user tries to make Chrome
269 // default browser (through the UI or through installer options) and Chrome
270 // is not registered on the machine.
271 // 268 //
269 // |elevate_if_not_admin| should only be true when following a user action
grt (UTC plus 2) 2012/06/11 17:57:38 merge this in with the documentation for |elevate_
gab 2012/06/11 19:38:11 Ah good catch! Done.
270 // (e.g. "Make Chrome Default") as it allows this method to UAC.
272 // |chrome_exe| full path to chrome.exe. 271 // |chrome_exe| full path to chrome.exe.
273 // |unique_suffix| Optional input. If given, this function appends the value 272 // |unique_suffix| Optional input. If given, this function appends the value
274 // to default browser entries names that it creates in the registry. 273 // to default browser entries names that it creates in the registry.
274 // Currently, this is only used to continue an install with the same suffix
275 // when elevating and calling setup.exe with admin privileges as described
276 // above.
275 // |elevate_if_not_admin| if true will make this method try alternate methods 277 // |elevate_if_not_admin| if true will make this method try alternate methods
276 // as described above. 278 // as described above.
279 //
280 // Returns true if Chrome is successfully registered (or already registered).
277 static bool RegisterChromeBrowser(BrowserDistribution* dist, 281 static bool RegisterChromeBrowser(BrowserDistribution* dist,
278 const string16& chrome_exe, 282 const string16& chrome_exe,
279 const string16& unique_suffix, 283 const string16& unique_suffix,
280 bool elevate_if_not_admin); 284 bool elevate_if_not_admin);
281 285
282 // This method declares to Windows that Chrome is capable of handling the 286 // This method declares to Windows that Chrome is capable of handling the
283 // given protocol. This function will call the RegisterChromeBrowser function 287 // given protocol. This function will call the RegisterChromeBrowser function
284 // to register with Windows as capable of handling the protocol, if it isn't 288 // to register with Windows as capable of handling the protocol, if it isn't
285 // currently registered as capable. 289 // currently registered as capable.
286 // Declaring the capability of handling a protocol is necessary to register 290 // Declaring the capability of handling a protocol is necessary to register
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 const string16& icon_path, 357 const string16& icon_path,
354 int icon_index, 358 int icon_index,
355 uint32 options); 359 uint32 options);
356 360
357 private: 361 private:
358 DISALLOW_COPY_AND_ASSIGN(ShellUtil); 362 DISALLOW_COPY_AND_ASSIGN(ShellUtil);
359 }; 363 };
360 364
361 365
362 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ 366 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698