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

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

Issue 10382155: browser: Refactor the way to show the user data dir dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/user_data_dir_dialog.h » ('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 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "chrome/browser/extensions/extension_service.h" 42 #include "chrome/browser/extensions/extension_service.h"
43 #include "chrome/browser/extensions/extensions_startup.h" 43 #include "chrome/browser/extensions/extensions_startup.h"
44 #include "chrome/browser/first_run/upgrade_util.h" 44 #include "chrome/browser/first_run/upgrade_util.h"
45 #include "chrome/browser/google/google_search_counter.h" 45 #include "chrome/browser/google/google_search_counter.h"
46 #include "chrome/browser/google/google_util.h" 46 #include "chrome/browser/google/google_util.h"
47 #include "chrome/browser/gpu_blacklist.h" 47 #include "chrome/browser/gpu_blacklist.h"
48 #include "chrome/browser/gpu_util.h" 48 #include "chrome/browser/gpu_util.h"
49 #include "chrome/browser/instant/instant_field_trial.h" 49 #include "chrome/browser/instant/instant_field_trial.h"
50 #include "chrome/browser/jankometer.h" 50 #include "chrome/browser/jankometer.h"
51 #include "chrome/browser/language_usage_metrics.h" 51 #include "chrome/browser/language_usage_metrics.h"
52 #include "chrome/browser/metrics/field_trial_synchronizer.h"
52 #include "chrome/browser/metrics/histogram_synchronizer.h" 53 #include "chrome/browser/metrics/histogram_synchronizer.h"
53 #include "chrome/browser/metrics/field_trial_synchronizer.h"
54 #include "chrome/browser/metrics/metrics_log.h" 54 #include "chrome/browser/metrics/metrics_log.h"
55 #include "chrome/browser/metrics/metrics_service.h" 55 #include "chrome/browser/metrics/metrics_service.h"
56 #include "chrome/browser/metrics/thread_watcher.h" 56 #include "chrome/browser/metrics/thread_watcher.h"
57 #include "chrome/browser/metrics/tracking_synchronizer.h" 57 #include "chrome/browser/metrics/tracking_synchronizer.h"
58 #include "chrome/browser/nacl_host/nacl_process_host.h" 58 #include "chrome/browser/nacl_host/nacl_process_host.h"
59 #include "chrome/browser/net/chrome_net_log.h" 59 #include "chrome/browser/net/chrome_net_log.h"
60 #include "chrome/browser/net/predictor.h" 60 #include "chrome/browser/net/predictor.h"
61 #include "chrome/browser/notifications/desktop_notification_service.h" 61 #include "chrome/browser/notifications/desktop_notification_service.h"
62 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 62 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
63 #include "chrome/browser/plugin_prefs.h" 63 #include "chrome/browser/plugin_prefs.h"
64 #include "chrome/browser/prefs/pref_service.h" 64 #include "chrome/browser/prefs/pref_service.h"
65 #include "chrome/browser/prefs/pref_value_store.h" 65 #include "chrome/browser/prefs/pref_value_store.h"
66 #include "chrome/browser/prefs/scoped_user_pref_update.h" 66 #include "chrome/browser/prefs/scoped_user_pref_update.h"
67 #include "chrome/browser/prerender/prerender_field_trial.h" 67 #include "chrome/browser/prerender/prerender_field_trial.h"
68 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 68 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
69 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 69 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
70 #include "chrome/browser/process_singleton.h" 70 #include "chrome/browser/process_singleton.h"
71 #include "chrome/browser/profiles/profile.h" 71 #include "chrome/browser/profiles/profile.h"
72 #include "chrome/browser/profiles/profile_manager.h" 72 #include "chrome/browser/profiles/profile_manager.h"
73 #include "chrome/browser/search_engines/search_engine_type.h" 73 #include "chrome/browser/search_engines/search_engine_type.h"
74 #include "chrome/browser/search_engines/template_url.h" 74 #include "chrome/browser/search_engines/template_url.h"
75 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" 75 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
76 #include "chrome/browser/search_engines/template_url_service.h" 76 #include "chrome/browser/search_engines/template_url_service.h"
77 #include "chrome/browser/search_engines/template_url_service_factory.h" 77 #include "chrome/browser/search_engines/template_url_service_factory.h"
78 #include "chrome/browser/service/service_process_control.h" 78 #include "chrome/browser/service/service_process_control.h"
79 #include "chrome/browser/shell_integration.h" 79 #include "chrome/browser/shell_integration.h"
80 #include "chrome/browser/translate/translate_manager.h" 80 #include "chrome/browser/translate/translate_manager.h"
81 #include "chrome/browser/ui/browser.h" 81 #include "chrome/browser/ui/browser.h"
82 #include "chrome/browser/ui/startup/startup_browser_creator.h" 82 #include "chrome/browser/ui/startup/startup_browser_creator.h"
83 #include "chrome/browser/ui/user_data_dir_dialog.h"
83 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" 84 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
84 #include "chrome/common/child_process_logging.h" 85 #include "chrome/common/child_process_logging.h"
85 #include "chrome/common/chrome_constants.h" 86 #include "chrome/common/chrome_constants.h"
86 #include "chrome/common/chrome_paths.h" 87 #include "chrome/common/chrome_paths.h"
87 #include "chrome/common/chrome_result_codes.h" 88 #include "chrome/common/chrome_result_codes.h"
88 #include "chrome/common/chrome_switches.h" 89 #include "chrome/common/chrome_switches.h"
89 #include "chrome/common/chrome_version_info.h" 90 #include "chrome/common/chrome_version_info.h"
90 #include "chrome/common/env_vars.h" 91 #include "chrome/common/env_vars.h"
91 #include "chrome/common/json_pref_store.h" 92 #include "chrome/common/json_pref_store.h"
92 #include "chrome/common/jstemplate_builder.h" 93 #include "chrome/common/jstemplate_builder.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 #if defined(OS_WIN) 142 #if defined(OS_WIN)
142 #include "base/environment.h" // For PreRead experiment. 143 #include "base/environment.h" // For PreRead experiment.
143 #include "base/win/windows_version.h" 144 #include "base/win/windows_version.h"
144 #include "chrome/browser/browser_trial.h" 145 #include "chrome/browser/browser_trial.h"
145 #include "chrome/browser/browser_util_win.h" 146 #include "chrome/browser/browser_util_win.h"
146 #include "chrome/browser/chrome_browser_main_win.h" 147 #include "chrome/browser/chrome_browser_main_win.h"
147 #include "chrome/browser/first_run/try_chrome_dialog_view.h" 148 #include "chrome/browser/first_run/try_chrome_dialog_view.h"
148 #include "chrome/browser/first_run/upgrade_util_win.h" 149 #include "chrome/browser/first_run/upgrade_util_win.h"
149 #include "chrome/browser/net/url_fixer_upper.h" 150 #include "chrome/browser/net/url_fixer_upper.h"
150 #include "chrome/browser/ui/views/network_profile_bubble.h" 151 #include "chrome/browser/ui/views/network_profile_bubble.h"
151 #include "chrome/browser/ui/views/user_data_dir_dialog.h"
152 #include "chrome/installer/util/helper.h" 152 #include "chrome/installer/util/helper.h"
153 #include "chrome/installer/util/install_util.h" 153 #include "chrome/installer/util/install_util.h"
154 #include "chrome/installer/util/shell_util.h" 154 #include "chrome/installer/util/shell_util.h"
155 #include "net/base/net_util.h" 155 #include "net/base/net_util.h"
156 #include "printing/printed_document.h" 156 #include "printing/printed_document.h"
157 #include "ui/base/l10n/l10n_util_win.h" 157 #include "ui/base/l10n/l10n_util_win.h"
158 #endif // defined(OS_WIN) 158 #endif // defined(OS_WIN)
159 159
160 #if defined(OS_MACOSX) 160 #if defined(OS_MACOSX)
161 #include <Security/Security.h> 161 #include <Security/Security.h>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 #if defined(OS_WIN) 385 #if defined(OS_WIN)
386 #if defined(USE_AURA) 386 #if defined(USE_AURA)
387 // TODO(beng): 387 // TODO(beng):
388 NOTIMPLEMENTED(); 388 NOTIMPLEMENTED();
389 #else 389 #else
390 // Ideally, we should be able to run w/o access to disk. For now, we 390 // Ideally, we should be able to run w/o access to disk. For now, we
391 // prompt the user to pick a different user-data-dir and restart chrome 391 // prompt the user to pick a different user-data-dir and restart chrome
392 // with the new dir. 392 // with the new dir.
393 // http://code.google.com/p/chromium/issues/detail?id=11510 393 // http://code.google.com/p/chromium/issues/detail?id=11510
394 FilePath new_user_data_dir = UserDataDirDialog::RunUserDataDirDialog( 394 FilePath new_user_data_dir = browser::ShowUserDataDirDialog(user_data_dir);
395 user_data_dir);
396 if (!parameters.ui_task && browser_shutdown::delete_resources_on_shutdown) { 395 if (!parameters.ui_task && browser_shutdown::delete_resources_on_shutdown) {
397 // Only delete the resources if we're not running tests. If we're running 396 // Only delete the resources if we're not running tests. If we're running
398 // tests the resources need to be reused as many places in the UI cache 397 // tests the resources need to be reused as many places in the UI cache
399 // SkBitmaps from the ResourceBundle. 398 // SkBitmaps from the ResourceBundle.
400 ResourceBundle::CleanupSharedInstance(); 399 ResourceBundle::CleanupSharedInstance();
401 } 400 }
402 401
403 if (!new_user_data_dir.empty()) { 402 if (!new_user_data_dir.empty()) {
404 // Because of the way CommandLine parses, it's sufficient to append a new 403 // Because of the way CommandLine parses, it's sufficient to append a new
405 // --user-data-dir switch. The last flag of the same name wins. 404 // --user-data-dir switch. The last flag of the same name wins.
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 if (base::win::GetVersion() <= base::win::VERSION_XP) 2006 if (base::win::GetVersion() <= base::win::VERSION_XP)
2008 uma_name += "_XP"; 2007 uma_name += "_XP";
2009 2008
2010 uma_name += "_PreRead_"; 2009 uma_name += "_PreRead_";
2011 uma_name += pre_read_percentage; 2010 uma_name += pre_read_percentage;
2012 AddPreReadHistogramTime(uma_name.c_str(), time); 2011 AddPreReadHistogramTime(uma_name.c_str(), time);
2013 } 2012 }
2014 #endif 2013 #endif
2015 #endif 2014 #endif
2016 } 2015 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/user_data_dir_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698