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

Unified Diff: chrome/browser/browser_init.cc

Issue 164341: Ensure we have a valid profile when using... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_init_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_init.cc
===================================================================
--- chrome/browser/browser_init.cc (revision 23072)
+++ chrome/browser/browser_init.cc (working copy)
@@ -377,6 +377,7 @@
const CommandLine& command_line)
: cur_dir_(cur_dir),
command_line_(command_line),
+ profile_(NULL),
browser_init_(NULL) {
}
@@ -386,6 +387,7 @@
BrowserInit* browser_init)
: cur_dir_(cur_dir),
command_line_(command_line),
+ profile_(NULL),
browser_init_(browser_init) {
}
@@ -554,6 +556,12 @@
bool process_startup,
const std::vector<GURL>& urls) {
DCHECK(!urls.empty());
+ // If we don't yet have a profile, try to use the one we're given from
+ // |browser|. While we may not end up actually using |browser| (since it
+ // could be a popup window), we can at least use the profile.
+ if (!profile_ && browser)
+ profile_ = browser->profile();
+
int pin_count = 0;
if (!browser) {
std::wstring pin_count_string =
« no previous file with comments | « no previous file | chrome/browser/browser_init_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698