| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/shell_integration.h" | 16 #include "chrome/browser/shell_integration.h" |
| 17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/installer/util/google_update_settings.h" | 18 #include "chrome/installer/util/google_update_settings.h" |
| 19 #include "chrome/installer/util/master_preferences.h" |
| 19 #include "content/common/result_codes.h" | 20 #include "content/common/result_codes.h" |
| 20 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 21 #include "ui/base/ui_base_switches.h" | 22 #include "ui/base/ui_base_switches.h" |
| 22 | 23 |
| 23 // TODO(port): This is just a piece of the silent import functionality from | 24 // TODO(port): This is just a piece of the silent import functionality from |
| 24 // ImportSettings for Windows. It would be nice to get the rest of it ported. | 25 // ImportSettings for Windows. It would be nice to get the rest of it ported. |
| 25 bool FirstRun::ImportBookmarks(const FilePath& import_bookmarks_path) { | 26 bool FirstRun::ImportBookmarks(const FilePath& import_bookmarks_path) { |
| 26 const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); | 27 const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); |
| 27 CommandLine import_cmd(cmdline.GetProgram()); | 28 CommandLine import_cmd(cmdline.GetProgram()); |
| 28 | 29 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 50 bool FirstRun::IsOrganicFirstRun() { | 51 bool FirstRun::IsOrganicFirstRun() { |
| 51 // We treat all installs as organic. | 52 // We treat all installs as organic. |
| 52 return true; | 53 return true; |
| 53 } | 54 } |
| 54 | 55 |
| 55 // static | 56 // static |
| 56 void FirstRun::PlatformSetup() { | 57 void FirstRun::PlatformSetup() { |
| 57 // Things that Windows does here (creating a desktop icon, for example) are | 58 // Things that Windows does here (creating a desktop icon, for example) are |
| 58 // handled at install time on Linux. | 59 // handled at install time on Linux. |
| 59 } | 60 } |
| 61 |
| 62 // static |
| 63 FilePath FirstRun::MasterPrefsPath() { |
| 64 // The standard location of the master prefs is next to the chrome binary. |
| 65 FilePath master_prefs; |
| 66 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
| 67 return FilePath(); |
| 68 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
| 69 } |
| OLD | NEW |