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

Side by Side Diff: chrome/installer/util/auto_launch_util.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
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 #include "chrome/installer/util/auto_launch_util.h" 5 #include "chrome/installer/util/auto_launch_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (!data_dir_paths.empty()) 55 if (!data_dir_paths.empty())
56 path = data_dir_paths[0]; 56 path = data_dir_paths[0];
57 } 57 }
58 path = path.Append(profile_directory); 58 path = path.Append(profile_directory);
59 59
60 std::string input(path.AsUTF8Unsafe()); 60 std::string input(path.AsUTF8Unsafe());
61 uint8 hash[16]; 61 uint8 hash[16];
62 crypto::SHA256HashString(input, hash, sizeof(hash)); 62 crypto::SHA256HashString(input, hash, sizeof(hash));
63 std::string hash_string = base::HexEncode(hash, sizeof(hash)); 63 std::string hash_string = base::HexEncode(hash, sizeof(hash));
64 return string16(kAutolaunchKeyValue) + 64 return string16(kAutolaunchKeyValue) +
65 ASCIIToWide("_") + ASCIIToWide(hash_string); 65 base::ASCIIToWide("_") + base::ASCIIToWide(hash_string);
66 } 66 }
67 67
68 // Returns whether the Chrome executable specified in |application_path| is set 68 // Returns whether the Chrome executable specified in |application_path| is set
69 // to auto-launch at computer startup with a given |command_line_switch|. 69 // to auto-launch at computer startup with a given |command_line_switch|.
70 // NOTE: |application_path| is optional and should be blank in most cases (as 70 // NOTE: |application_path| is optional and should be blank in most cases (as
71 // it will default to the application path of the current executable). 71 // it will default to the application path of the current executable).
72 // |profile_directory| is the name of the directory (leaf, not the full path) 72 // |profile_directory| is the name of the directory (leaf, not the full path)
73 // that contains the profile that should be opened at computer startup. 73 // that contains the profile that should be opened at computer startup.
74 // |command_line_switch| is the switch we are optionally interested in and, if 74 // |command_line_switch| is the switch we are optionally interested in and, if
75 // not blank, must be present for the function to return true. If blank, it acts 75 // not blank, must be present for the function to return true. If blank, it acts
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 246 }
247 247
248 void DisableBackgroundStartAtLogin() { 248 void DisableBackgroundStartAtLogin() {
249 SetWillLaunchAtLogin(base::FilePath(), 249 SetWillLaunchAtLogin(base::FilePath(),
250 ASCIIToUTF16(chrome::kInitialProfile), 250 ASCIIToUTF16(chrome::kInitialProfile),
251 FLAG_PRESERVE, 251 FLAG_PRESERVE,
252 FLAG_DISABLE); 252 FLAG_DISABLE);
253 } 253 }
254 254
255 } // namespace auto_launch_util 255 } // namespace auto_launch_util
OLDNEW
« no previous file with comments | « chrome/installer/test/alternate_version_generator.cc ('k') | chrome/installer/util/google_chrome_distribution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698