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

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

Issue 1986823002: Reset user data directory and disk cache directory after downgrade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr Created 4 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
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 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 #include "chrome/app/file_pre_reader_win.h" 199 #include "chrome/app/file_pre_reader_win.h"
200 #include "chrome/browser/browser_util_win.h" 200 #include "chrome/browser/browser_util_win.h"
201 #include "chrome/browser/chrome_browser_main_win.h" 201 #include "chrome/browser/chrome_browser_main_win.h"
202 #include "chrome/browser/chrome_select_file_dialog_factory_win.h" 202 #include "chrome/browser/chrome_select_file_dialog_factory_win.h"
203 #include "chrome/browser/component_updater/caps_installer_win.h" 203 #include "chrome/browser/component_updater/caps_installer_win.h"
204 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" 204 #include "chrome/browser/component_updater/sw_reporter_installer_win.h"
205 #include "chrome/browser/first_run/try_chrome_dialog_view.h" 205 #include "chrome/browser/first_run/try_chrome_dialog_view.h"
206 #include "chrome/browser/first_run/upgrade_util_win.h" 206 #include "chrome/browser/first_run/upgrade_util_win.h"
207 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 207 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
208 #include "chrome/browser/ui/network_profile_bubble.h" 208 #include "chrome/browser/ui/network_profile_bubble.h"
209 #include "chrome/browser/user_data_downgrade.h"
209 #include "chrome/installer/util/browser_distribution.h" 210 #include "chrome/installer/util/browser_distribution.h"
210 #include "chrome/installer/util/helper.h" 211 #include "chrome/installer/util/helper.h"
211 #include "chrome/installer/util/install_util.h" 212 #include "chrome/installer/util/install_util.h"
212 #include "chrome/installer/util/module_util_win.h" 213 #include "chrome/installer/util/module_util_win.h"
213 #include "chrome/installer/util/shell_util.h" 214 #include "chrome/installer/util/shell_util.h"
214 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win. h" 215 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win. h"
215 #include "ui/base/l10n/l10n_util_win.h" 216 #include "ui/base/l10n/l10n_util_win.h"
216 #include "ui/shell_dialogs/select_file_dialog.h" 217 #include "ui/shell_dialogs/select_file_dialog.h"
217 #endif // defined(OS_WIN) 218 #endif // defined(OS_WIN)
218 219
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 // main message loop. 1778 // main message loop.
1778 std::vector<Profile*> last_opened_profiles; 1779 std::vector<Profile*> last_opened_profiles;
1779 #if !defined(OS_CHROMEOS) 1780 #if !defined(OS_CHROMEOS)
1780 // On ChromeOS multiple profiles doesn't apply, and will break if we load 1781 // On ChromeOS multiple profiles doesn't apply, and will break if we load
1781 // them this early as the cryptohome hasn't yet been mounted (which happens 1782 // them this early as the cryptohome hasn't yet been mounted (which happens
1782 // only once we log in). 1783 // only once we log in).
1783 last_opened_profiles = 1784 last_opened_profiles =
1784 g_browser_process->profile_manager()->GetLastOpenedProfiles(); 1785 g_browser_process->profile_manager()->GetLastOpenedProfiles();
1785 #endif // defined(OS_CHROMEOS) 1786 #endif // defined(OS_CHROMEOS)
1786 1787
1788 #if defined(OS_WIN)
1789 // Clean up old user data directory and disk cache directory
grt (UTC plus 2) 2016/05/19 23:39:27 nit: '.' at end of sentence
zmin 2016/05/20 00:52:25 Done.
1790 DeleteMovedUserDataSoon();
1791 #endif
1792
1787 UMA_HISTOGRAM_TIMES("Startup.PreMainMessageLoopRunImplStep2Time", 1793 UMA_HISTOGRAM_TIMES("Startup.PreMainMessageLoopRunImplStep2Time",
1788 base::TimeTicks::Now() - start_time_step2); 1794 base::TimeTicks::Now() - start_time_step2);
1789 1795
1790 // This step is costly and is already measured in 1796 // This step is costly and is already measured in
1791 // Startup.StartupBrowserCreator_Start. 1797 // Startup.StartupBrowserCreator_Start.
1792 const bool started = browser_creator_->Start( 1798 const bool started = browser_creator_->Start(
1793 parsed_command_line(), base::FilePath(), profile_, last_opened_profiles); 1799 parsed_command_line(), base::FilePath(), profile_, last_opened_profiles);
1794 const base::TimeTicks start_time_step3 = base::TimeTicks::Now(); 1800 const base::TimeTicks start_time_step3 = base::TimeTicks::Now();
1795 if (started) { 1801 if (started) {
1796 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) 1802 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 chromeos::CrosSettings::Shutdown(); 2000 chromeos::CrosSettings::Shutdown();
1995 #endif // defined(OS_CHROMEOS) 2001 #endif // defined(OS_CHROMEOS)
1996 #endif // defined(OS_ANDROID) 2002 #endif // defined(OS_ANDROID)
1997 } 2003 }
1998 2004
1999 // Public members: 2005 // Public members:
2000 2006
2001 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2007 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2002 chrome_extra_parts_.push_back(parts); 2008 chrome_extra_parts_.push_back(parts);
2003 } 2009 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698