Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "chrome/browser/importer/importer_host.h" | |
| 16 #include "chrome/browser/prefs/pref_service.h" | |
| 15 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 16 | 18 |
| 17 class CommandLine; | 19 class CommandLine; |
| 18 class FilePath; | 20 class FilePath; |
| 19 class GURL; | 21 class GURL; |
| 20 class Profile; | 22 class Profile; |
| 21 class ProcessSingleton; | 23 class ProcessSingleton; |
| 22 class ImporterHost; | 24 class ImporterHost; |
| 23 class ImporterList; | 25 class ImporterList; |
| 24 | 26 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 static bool SetPersonalDataManagerFirstRunPref(); | 144 static bool SetPersonalDataManagerFirstRunPref(); |
| 143 | 145 |
| 144 // True if special circumstances should prevent the search engine ballot from | 146 // True if special circumstances should prevent the search engine ballot from |
| 145 // being shown. | 147 // being shown. |
| 146 static bool SearchEngineSelectorDisallowed(); | 148 static bool SearchEngineSelectorDisallowed(); |
| 147 | 149 |
| 148 private: | 150 private: |
| 149 friend class FirstRunTest; | 151 friend class FirstRunTest; |
| 150 FRIEND_TEST_ALL_PREFIXES(Toolbar5ImporterTest, BookmarkParse); | 152 FRIEND_TEST_ALL_PREFIXES(Toolbar5ImporterTest, BookmarkParse); |
| 151 | 153 |
| 154 // Sets the |items| bitfield according to whether the import data specified by | |
| 155 // |import_type| should be be auto imported or not. | |
| 156 static void SetImportItem(PrefService* user_prefs, | |
|
James Hawkins
2011/08/01 19:41:51
Move to an unnamed namespace in the implementation
simo
2011/08/02 09:08:14
Done.
| |
| 157 const char* pref_path, | |
| 158 int import_items, | |
| 159 int dont_import_items, | |
| 160 importer::ImportItem import_type, | |
| 161 int& items); | |
| 162 | |
| 152 #if defined(OS_WIN) | 163 #if defined(OS_WIN) |
| 153 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns | 164 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns |
| 154 // true if successful. | 165 // true if successful. |
| 155 static bool WriteEULAtoTempFile(FilePath* eula_path); | 166 static bool WriteEULAtoTempFile(FilePath* eula_path); |
| 156 | 167 |
| 157 // Launches the setup exe with the given parameter/value on the command-line, | 168 // Launches the setup exe with the given parameter/value on the command-line, |
| 158 // waits for its termination, returns its exit code in |*ret_code|, and | 169 // waits for its termination, returns its exit code in |*ret_code|, and |
| 159 // returns true if the exit code is valid. | 170 // returns true if the exit code is valid. |
| 160 static bool LaunchSetupWithParam(const std::string& param, | 171 static bool LaunchSetupWithParam(const std::string& param, |
| 161 const std::wstring& value, | 172 const std::wstring& value, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 }; | 208 }; |
| 198 | 209 |
| 199 // This variable should only be accessed through IsChromeFirstRun(). | 210 // This variable should only be accessed through IsChromeFirstRun(). |
| 200 static FirstRunState first_run_; | 211 static FirstRunState first_run_; |
| 201 | 212 |
| 202 // This class is for scoping purposes. | 213 // This class is for scoping purposes. |
| 203 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); | 214 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); |
| 204 }; | 215 }; |
| 205 | 216 |
| 206 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 217 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| OLD | NEW |