OLD | NEW |
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/browser/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 void SetImportPreferencesAndLaunchImport( | 120 void SetImportPreferencesAndLaunchImport( |
121 MasterPrefs* out_prefs, | 121 MasterPrefs* out_prefs, |
122 installer::MasterPreferences* install_prefs) { | 122 installer::MasterPreferences* install_prefs) { |
123 std::string import_bookmarks_path; | 123 std::string import_bookmarks_path; |
124 install_prefs->GetString( | 124 install_prefs->GetString( |
125 installer::master_preferences::kDistroImportBookmarksFromFilePref, | 125 installer::master_preferences::kDistroImportBookmarksFromFilePref, |
126 &import_bookmarks_path); | 126 &import_bookmarks_path); |
127 if (!import_bookmarks_path.empty()) { | 127 if (!import_bookmarks_path.empty()) { |
128 // There are bookmarks to import from a file. | 128 // There are bookmarks to import from a file. |
129 base::FilePath path = base::FilePath::FromWStringHack(UTF8ToWide( | 129 base::FilePath path = base::FilePath::FromWStringHack(base::UTF8ToWide( |
130 import_bookmarks_path)); | 130 import_bookmarks_path)); |
131 if (!ImportBookmarks(path)) { | 131 if (!ImportBookmarks(path)) { |
132 LOG(WARNING) << "silent bookmark import failed"; | 132 LOG(WARNING) << "silent bookmark import failed"; |
133 } | 133 } |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) { | 137 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) { |
138 // The EULA is only handled on Windows. | 138 // The EULA is only handled on Windows. |
139 return true; | 139 return true; |
140 } | 140 } |
141 | 141 |
142 } // namespace internal | 142 } // namespace internal |
143 } // namespace first_run | 143 } // namespace first_run |
144 | 144 |
145 namespace first_run { | 145 namespace first_run { |
146 | 146 |
147 // TODO(port): Import switches need to be ported to both Mac and Linux. Not all | 147 // TODO(port): Import switches need to be ported to both Mac and Linux. Not all |
148 // import switches here are implemented for Linux. None are implemented for Mac | 148 // import switches here are implemented for Linux. None are implemented for Mac |
149 // (as this function will not be called on Mac). | 149 // (as this function will not be called on Mac). |
150 int ImportNow(Profile* profile, const CommandLine& cmdline) { | 150 int ImportNow(Profile* profile, const CommandLine& cmdline) { |
151 return internal::ImportBookmarkFromFileIfNeeded(profile, cmdline); | 151 return internal::ImportBookmarkFromFileIfNeeded(profile, cmdline); |
152 } | 152 } |
153 | 153 |
154 } // namespace first_run | 154 } // namespace first_run |
OLD | NEW |