OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/notifications/balloon_collection.h" | 14 #include "chrome/browser/notifications/balloon_collection.h" |
15 #include "chrome/browser/notifications/desktop_notification_service.h" | 15 #include "chrome/browser/notifications/desktop_notification_service.h" |
16 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 16 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
17 #include "chrome/browser/notifications/notification.h" | 17 #include "chrome/browser/notifications/notification.h" |
18 #include "chrome/browser/notifications/notification_prefs_manager.h" | 18 #include "chrome/browser/notifications/notification_prefs_manager.h" |
19 #include "chrome/browser/notifications/notification_ui_manager.h" | 19 #include "chrome/browser/notifications/notification_ui_manager.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/browser_finder.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/content_settings_types.h" | 24 #include "chrome/common/content_settings_types.h" |
24 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
25 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
26 #include "content/public/browser/web_contents_delegate.h" | 27 #include "content/public/browser/web_contents_delegate.h" |
27 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
28 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
29 | 30 |
30 // Menu commands | 31 // Menu commands |
31 const int kTogglePermissionCommand = 0; | 32 const int kTogglePermissionCommand = 0; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (extension_service->IsExtensionEnabled(id)) | 242 if (extension_service->IsExtensionEnabled(id)) |
242 extension_service->DisableExtension( | 243 extension_service->DisableExtension( |
243 id, Extension::DISABLE_USER_ACTION); | 244 id, Extension::DISABLE_USER_ACTION); |
244 else | 245 else |
245 extension_service->EnableExtension(id); | 246 extension_service->EnableExtension(id); |
246 } | 247 } |
247 break; | 248 break; |
248 } | 249 } |
249 case kOpenContentSettingsCommand: { | 250 case kOpenContentSettingsCommand: { |
250 Browser* browser = | 251 Browser* browser = |
251 BrowserList::GetLastActiveWithProfile(balloon_->profile()); | 252 browser::FindLastActiveWithProfile(balloon_->profile()); |
252 if (!browser) { | 253 if (!browser) { |
253 // It is possible that there is no browser window (e.g. when there are | 254 // It is possible that there is no browser window (e.g. when there are |
254 // background pages, or for a chrome frame process on windows). | 255 // background pages, or for a chrome frame process on windows). |
255 browser = Browser::Create(balloon_->profile()); | 256 browser = Browser::Create(balloon_->profile()); |
256 } | 257 } |
257 browser->ShowContentSettingsPage(CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 258 browser->ShowContentSettingsPage(CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
258 break; | 259 break; |
259 } | 260 } |
260 default: | 261 default: |
261 NOTREACHED(); | 262 NOTREACHED(); |
262 break; | 263 break; |
263 } | 264 } |
264 } | 265 } |
OLD | NEW |