diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 18:35:46 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 18:35:46 +0000 |
commit | 9b31bd4702dbd4ac071170f647fde81b999b27f9 (patch) | |
tree | 8ab23897ae03aa3c5ab003fa2d4a90b8a144d5eb /chrome | |
parent | 8a3011445c4b38659d368a2f1e41623696d6f00e (diff) | |
download | chromium_src-9b31bd4702dbd4ac071170f647fde81b999b27f9.zip chromium_src-9b31bd4702dbd4ac071170f647fde81b999b27f9.tar.gz chromium_src-9b31bd4702dbd4ac071170f647fde81b999b27f9.tar.bz2 |
Fix opening settings page for balloons.
BUG=67181
TEST=manually, see bug
Review URL: http://codereview.chromium.org/6833014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/notifications/notification_options_menu_model.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/notifications/notification_options_menu_model.cc b/chrome/browser/notifications/notification_options_menu_model.cc index 7024142..065c7e9 100644 --- a/chrome/browser/notifications/notification_options_menu_model.cc +++ b/chrome/browser/notifications/notification_options_menu_model.cc @@ -10,7 +10,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/notifications/balloon_collection.h" -#include "chrome/browser/notifications/balloon_host.h" #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/desktop_notification_service_factory.h" #include "chrome/browser/notifications/notification.h" @@ -22,7 +21,7 @@ #include "chrome/common/content_settings_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/tab_contents/tab_contents_delegate.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -235,9 +234,14 @@ void NotificationOptionsMenuModel::ExecuteCommand(int command_id) { break; } case kOpenContentSettingsCommand: { - TabContents* tab_contents = - balloon_->view()->GetHost()->associated_tab_contents(); - tab_contents->delegate()->ShowContentSettingsPage( + Browser* browser = + BrowserList::GetLastActiveWithProfile(balloon_->profile()); + if (!browser) { + // It is possible that there is no browser window (e.g. when there are + // background pages, or for a chrome frame process on windows). + browser = Browser::Create(balloon_->profile()); + } + static_cast<TabContentsDelegate*>(browser)->ShowContentSettingsPage( CONTENT_SETTINGS_TYPE_NOTIFICATIONS); break; } |