diff options
author | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 14:30:59 +0000 |
---|---|---|
committer | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 14:30:59 +0000 |
commit | ed179282afe5c8707527ea134591c78052913105 (patch) | |
tree | bc53e738db0b8d496b3ac0d7d5f470fce160e3a4 /chrome/browser/chromeos/sim_dialog_delegate.cc | |
parent | 11ecab303f15e6c75e436b2a45920cc3a26a6c3c (diff) | |
download | chromium_src-ed179282afe5c8707527ea134591c78052913105.zip chromium_src-ed179282afe5c8707527ea134591c78052913105.tar.gz chromium_src-ed179282afe5c8707527ea134591c78052913105.tar.bz2 |
[cros] Use correct profile for mobile dialogs. No crash when inside user session there's no browser window
BUG=120854
TEST=Manual. No crash (see bug).
Review URL: https://chromiumcodereview.appspot.com/9909010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/sim_dialog_delegate.cc')
-rw-r--r-- | chrome/browser/chromeos/sim_dialog_delegate.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/chromeos/sim_dialog_delegate.cc b/chrome/browser/chromeos/sim_dialog_delegate.cc index 8aeb6cc..82d0cea 100644 --- a/chrome/browser/chromeos/sim_dialog_delegate.cc +++ b/chrome/browser/chromeos/sim_dialog_delegate.cc @@ -48,17 +48,11 @@ namespace chromeos { // static void SimDialogDelegate::ShowDialog(gfx::NativeWindow owning_window, SimDialogMode mode) { - Profile* profile; - Browser* browser = NULL; - if (UserManager::Get()->IsUserLoggedIn()) { - browser = BrowserList::GetLastActive(); - DCHECK(browser); - profile = browser->profile(); - } else { - profile = ProfileManager::GetDefaultProfile(); - } + Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); HtmlDialogView* html_view = - new HtmlDialogView(profile, browser, new SimDialogDelegate(mode)); + new HtmlDialogView(profile, + BrowserList::GetLastActive(), + new SimDialogDelegate(mode)); html_view->InitDialog(); views::Widget::CreateWindowWithParent(html_view, owning_window); html_view->GetWidget()->Show(); |