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

Side by Side Diff: chrome/browser/chrome_browser_main.h

Issue 20483002: Merge 3 different ways of obtaining first run state into a single one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r214457 -- fix conflict with r214339 -- dcommit since tests pass on previous patch set Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CHROME_BROWSER_MAIN_H_ 5 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_
6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ 6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 virtual void ShowMissingLocaleMessageBox() = 0; 94 virtual void ShowMissingLocaleMessageBox() = 0;
95 95
96 const content::MainFunctionParams& parameters() const { 96 const content::MainFunctionParams& parameters() const {
97 return parameters_; 97 return parameters_;
98 } 98 }
99 const CommandLine& parsed_command_line() const { 99 const CommandLine& parsed_command_line() const {
100 return parsed_command_line_; 100 return parsed_command_line_;
101 } 101 }
102 102
103 Profile* profile() { return profile_; } 103 Profile* profile() { return profile_; }
104 bool do_first_run_tasks() const { return do_first_run_tasks_; }
105 104
106 const PrefService* local_state() const { return local_state_; } 105 const PrefService* local_state() const { return local_state_; }
107 106
108 private: 107 private:
109 // Methods for |SetupMetricsAndFieldTrials()| -------------------------------- 108 // Methods for |SetupMetricsAndFieldTrials()| --------------------------------
110 109
111 // Constructs metrics service and does related initialization, including 110 // Constructs metrics service and does related initialization, including
112 // creation of field trials. Call only after labs have been converted to 111 // creation of field trials. Call only after labs have been converted to
113 // switches. 112 // switches.
114 void SetupMetricsAndFieldTrials(); 113 void SetupMetricsAndFieldTrials();
115 114
116 // Starts recording of metrics. This can only be called after we have a file 115 // Starts recording of metrics. This can only be called after we have a file
117 // thread. 116 // thread.
118 void StartMetricsRecording(); 117 void StartMetricsRecording();
119 118
120 // Returns true if the user opted in to sending metric reports. 119 // Returns true if the user opted in to sending metric reports.
121 bool IsMetricsReportingEnabled(); 120 bool IsMetricsReportingEnabled();
122 121
123 // Record time from process startup to present time in an UMA histogram. 122 // Record time from process startup to present time in an UMA histogram.
124 // |is_first_run| - is the current launch part of a first run. 123 void RecordBrowserStartupTime();
125 void RecordBrowserStartupTime(bool is_first_run);
126 124
127 // Records a time value to an UMA histogram in the context of the 125 // Records a time value to an UMA histogram in the context of the
128 // PreReadExperiment field-trial. This also reports to the appropriate 126 // PreReadExperiment field-trial. This also reports to the appropriate
129 // sub-histogram (_PreRead(Enabled|Disabled)). 127 // sub-histogram (_PreRead(Enabled|Disabled)).
130 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); 128 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time);
131 129
132 // Methods for Main Message Loop ------------------------------------------- 130 // Methods for Main Message Loop -------------------------------------------
133 131
134 int PreCreateThreadsImpl(); 132 int PreCreateThreadsImpl();
135 int PreMainMessageLoopRunImpl(); 133 int PreMainMessageLoopRunImpl();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 Profile* profile_; 186 Profile* profile_;
189 bool run_message_loop_; 187 bool run_message_loop_;
190 ProcessSingleton::NotifyResult notify_result_; 188 ProcessSingleton::NotifyResult notify_result_;
191 scoped_ptr<ThreeDAPIObserver> three_d_observer_; 189 scoped_ptr<ThreeDAPIObserver> three_d_observer_;
192 190
193 // Initialized in SetupMetricsAndFieldTrials. 191 // Initialized in SetupMetricsAndFieldTrials.
194 scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_; 192 scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_;
195 193
196 // Members initialized in PreMainMessageLoopRun, needed in 194 // Members initialized in PreMainMessageLoopRun, needed in
197 // PreMainMessageLoopRunThreadsCreated. 195 // PreMainMessageLoopRunThreadsCreated.
198 bool do_first_run_tasks_;
199 PrefService* local_state_; 196 PrefService* local_state_;
200 base::FilePath user_data_dir_; 197 base::FilePath user_data_dir_;
201 198
202 #if !defined(OS_ANDROID) 199 #if !defined(OS_ANDROID)
203 scoped_ptr<ActiveTabTracker> active_tab_tracker_; 200 scoped_ptr<ActiveTabTracker> active_tab_tracker_;
204 #endif 201 #endif
205 202
206 // Members needed across shutdown methods. 203 // Members needed across shutdown methods.
207 bool restart_last_session_; 204 bool restart_last_session_;
208 205
209 // Tests can set this to true to disable restricting cookie access in the 206 // Tests can set this to true to disable restricting cookie access in the
210 // network stack, as this can only be done once. 207 // network stack, as this can only be done once.
211 static bool disable_enforcing_cookie_policies_for_tests_; 208 static bool disable_enforcing_cookie_policies_for_tests_;
212 209
213 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts); 210 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts);
214 }; 211 };
215 212
216 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ 213 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698