| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/notifications/notification_options_menu_model.h" | 5 #include "chrome/browser/notifications/notification_options_menu_model.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/notifications/balloon_collection.h" | 12 #include "chrome/browser/notifications/balloon_collection.h" |
| 13 #include "chrome/browser/notifications/desktop_notification_service.h" | 13 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 14 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 14 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 15 #include "chrome/browser/notifications/notification.h" | 15 #include "chrome/browser/notifications/notification.h" |
| 16 #include "chrome/browser/notifications/notification_ui_manager.h" | 16 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 17 #include "chrome/browser/notifications/notifications_prefs_cache.h" | 17 #include "chrome/browser/notifications/notifications_prefs_cache.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
| 20 #include "chrome/browser/ui/content_settings/content_settings_tab_helper_delegat
e.h" |
| 20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/content_settings_types.h" | 22 #include "chrome/common/content_settings_types.h" |
| 22 #include "chrome/common/extensions/extension.h" | 23 #include "chrome/common/extensions/extension.h" |
| 23 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
| 24 #include "content/browser/tab_contents/tab_contents_delegate.h" | 25 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 25 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 27 | 28 |
| 28 // Menu commands | 29 // Menu commands |
| 29 const int kTogglePermissionCommand = 0; | 30 const int kTogglePermissionCommand = 0; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 break; | 235 break; |
| 235 } | 236 } |
| 236 case kOpenContentSettingsCommand: { | 237 case kOpenContentSettingsCommand: { |
| 237 Browser* browser = | 238 Browser* browser = |
| 238 BrowserList::GetLastActiveWithProfile(balloon_->profile()); | 239 BrowserList::GetLastActiveWithProfile(balloon_->profile()); |
| 239 if (!browser) { | 240 if (!browser) { |
| 240 // It is possible that there is no browser window (e.g. when there are | 241 // It is possible that there is no browser window (e.g. when there are |
| 241 // background pages, or for a chrome frame process on windows). | 242 // background pages, or for a chrome frame process on windows). |
| 242 browser = Browser::Create(balloon_->profile()); | 243 browser = Browser::Create(balloon_->profile()); |
| 243 } | 244 } |
| 244 static_cast<TabContentsDelegate*>(browser)->ShowContentSettingsPage( | 245 static_cast<ContentSettingsTabHelperDelegate*>(browser)-> |
| 245 CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 246 ShowContentSettingsPage(CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
| 246 break; | 247 break; |
| 247 } | 248 } |
| 248 default: | 249 default: |
| 249 NOTREACHED(); | 250 NOTREACHED(); |
| 250 break; | 251 break; |
| 251 } | 252 } |
| 252 } | 253 } |
| OLD | NEW |