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

Side by Side Diff: trunk/src/chrome/browser/first_run/first_run_internal.h

Issue 15968002: Revert 201837 "OOP import on Windows." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ 5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_
6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/message_loop.h"
15 #include "chrome/browser/importer/importer_progress_observer.h"
14 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
15 17
16 class CommandLine; 18 class CommandLine;
17 class GURL; 19 class GURL;
18 class ImporterHost; 20 class ImporterHost;
19 class ImporterList; 21 class ImporterList;
20 class Profile; 22 class Profile;
21 class ProcessSingleton; 23 class ProcessSingleton;
22 class TemplateURLService; 24 class TemplateURLService;
23 25
(...skipping 11 matching lines...) Expand all
35 37
36 enum FirstRunState { 38 enum FirstRunState {
37 FIRST_RUN_UNKNOWN, // The state is not tested or set yet. 39 FIRST_RUN_UNKNOWN, // The state is not tested or set yet.
38 FIRST_RUN_TRUE, 40 FIRST_RUN_TRUE,
39 FIRST_RUN_FALSE 41 FIRST_RUN_FALSE
40 }; 42 };
41 43
42 // This variable should only be accessed through IsChromeFirstRun(). 44 // This variable should only be accessed through IsChromeFirstRun().
43 extern FirstRunState first_run_; 45 extern FirstRunState first_run_;
44 46
47 // This class acts as an observer for the ImporterProgressObserver::ImportEnded
48 // callback. When the import process is started, certain errors may cause
49 // ImportEnded() to be called synchronously, but the typical case is that
50 // ImportEnded() is called asynchronously. Thus we have to handle both cases.
51 // TODO(gab): Move this to the unnamed namespace of first_run.cc as part of the
52 // refactoring for OOP import (http://crbug.com/219419).
53 class ImportEndedObserver : public importer::ImporterProgressObserver {
54 public:
55 ImportEndedObserver() : ended_(false),
56 should_quit_message_loop_(false) {}
57 virtual ~ImportEndedObserver() {}
58
59 // importer::ImporterProgressObserver:
60 virtual void ImportStarted() OVERRIDE {}
61 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {}
62 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {}
63 virtual void ImportEnded() OVERRIDE;
64
65 void set_should_quit_message_loop() {
66 should_quit_message_loop_ = true;
67 }
68
69 bool ended() const {
70 return ended_;
71 }
72
73 private:
74 // Set if the import has ended.
75 bool ended_;
76
77 // Set by the client (via set_should_quit_message_loop) if, when the import
78 // ends, this class should quit the message loop.
79 bool should_quit_message_loop_;
80 };
81
45 // Loads master preferences from the master preference file into the installer 82 // Loads master preferences from the master preference file into the installer
46 // master preferences. Passes the master preference file path out in 83 // master preferences. Passes the master preference file path out in
47 // master_prefs_path. Returns the pointer to installer::MasterPreferences object 84 // master_prefs_path. Returns the pointer to installer::MasterPreferences object
48 // if successful; otherwise, returns NULL. 85 // if successful; otherwise, returns NULL.
49 installer::MasterPreferences* LoadMasterPrefs( 86 installer::MasterPreferences* LoadMasterPrefs(
50 base::FilePath* master_prefs_path); 87 base::FilePath* master_prefs_path);
51 88
52 // Copies user preference file to master preference file. Returns true if 89 // Copies user preference file to master preference file. Returns true if
53 // successful. 90 // successful.
54 bool CopyPrefFile(const base::FilePath& user_data_dir, 91 bool CopyPrefFile(const base::FilePath& user_data_dir,
(...skipping 12 matching lines...) Expand all
67 104
68 // Gives the full path to the sentinel file. The file might not exist. 105 // Gives the full path to the sentinel file. The file might not exist.
69 // This function has a common implementation on OS_POSIX and a windows specific 106 // This function has a common implementation on OS_POSIX and a windows specific
70 // implementation. 107 // implementation.
71 bool GetFirstRunSentinelFilePath(base::FilePath* path); 108 bool GetFirstRunSentinelFilePath(base::FilePath* path);
72 109
73 // This function has a common implementationin for all non-linux platforms, and 110 // This function has a common implementationin for all non-linux platforms, and
74 // a linux specific implementation. 111 // a linux specific implementation.
75 bool IsOrganicFirstRun(); 112 bool IsOrganicFirstRun();
76 113
114 // Imports settings. This may be done in a separate process depending on the
115 // platform, but it will always block until done. The return value indicates
116 // success.
117 // This functions has a common implementation for OS_POSIX, and a
118 // windows specific implementation.
119 bool ImportSettings(Profile* profile,
120 ImporterHost* importer_host,
121 scoped_refptr<ImporterList> importer_list,
122 int items_to_import);
123
124 // Sets import preferences and launch the import process.
125 void SetImportPreferencesAndLaunchImport(
126 MasterPrefs* out_prefs,
127 installer::MasterPreferences* install_prefs);
128
129 int ImportBookmarkFromFileIfNeeded(Profile* profile,
130 const CommandLine& cmdline);
131
132 #if !defined(OS_WIN)
133 bool ImportBookmarks(const base::FilePath& import_bookmarks_path);
134 #endif
135
77 // Shows the EULA dialog if required. Returns true if the EULA is accepted, 136 // Shows the EULA dialog if required. Returns true if the EULA is accepted,
78 // returns false if the EULA has not been accepted, in which case the browser 137 // returns false if the EULA has not been accepted, in which case the browser
79 // should exit. 138 // should exit.
80 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs); 139 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs);
81 140
82 // Returns the path for the master preferences file. 141 // Returns the path for the master preferences file.
83 base::FilePath MasterPrefsPath(); 142 base::FilePath MasterPrefsPath();
84 143
85 } // namespace internal 144 } // namespace internal
86 } // namespace first_run 145 } // namespace first_run
87 146
88 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ 147 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/first_run/first_run_browsertest.cc ('k') | trunk/src/chrome/browser/first_run/first_run_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698