Commit 0744cc71 authored by mirandac@chromium.org's avatar mirandac@chromium.org

Fix call to GetDefaultBrowser in print cloud because we are no longer...

Fix call to GetDefaultBrowser in print cloud because we are no longer guaranteed to have a Default profile in multi-profile land.

BUG=83792
TEST=PrintCloud works fine in Mac OS with no open windows.

Review URL: http://codereview.chromium.org/7616011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96546 0039d316-1c4b-4281-b951-d872f2087c98
parent 46e06179
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/debugger/devtools_window.h" #include "chrome/browser/debugger/devtools_window.h"
#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_url.h" #include "chrome/browser/printing/cloud_print/cloud_print_url.h"
...@@ -536,7 +537,10 @@ void CreateDialogImpl(const FilePath& path_to_file, ...@@ -536,7 +537,10 @@ void CreateDialogImpl(const FilePath& path_to_file,
job_title = browser->GetSelectedTabContents()->GetTitle(); job_title = browser->GetSelectedTabContents()->GetTitle();
profile = browser->GetProfile(); profile = browser->GetProfile();
} else { } else {
profile = ProfileManager::GetDefaultProfile(); std::vector<Profile*> loaded_profiles =
g_browser_process->profile_manager()->GetLoadedProfiles();
DCHECK_GT(loaded_profiles.size(), 0U);
profile = loaded_profiles[0];
} }
DCHECK(profile); DCHECK(profile);
PrefService* pref_service = profile->GetPrefs(); PrefService* pref_service = profile->GetPrefs();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment