| 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/ui/views/ash/balloon_collection_impl_ash.h" | 5 #include "chrome/browser/ui/views/ash/balloon_collection_impl_ash.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/web_notification/web_notification_tray.h" | 8 #include "ash/system/web_notification/web_notification_tray.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/notifications/balloon.h" | 10 #include "chrome/browser/notifications/balloon.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void BalloonCollectionImplAsh::NotificationRemoved( | 62 void BalloonCollectionImplAsh::NotificationRemoved( |
| 63 const std::string& notification_id) { | 63 const std::string& notification_id) { |
| 64 RemoveById(notification_id); | 64 RemoveById(notification_id); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void BalloonCollectionImplAsh::ShowSettings( | 67 void BalloonCollectionImplAsh::ShowSettings( |
| 68 const std::string& notification_id) { | 68 const std::string& notification_id) { |
| 69 Balloon* balloon = base().FindBalloonById(notification_id); | 69 Balloon* balloon = base().FindBalloonById(notification_id); |
| 70 Profile* profile = | 70 Profile* profile = |
| 71 balloon ? balloon->profile() : ProfileManager::GetDefaultProfile(); | 71 balloon ? balloon->profile() : ProfileManager::GetDefaultProfile(); |
| 72 Browser* browser = | 72 Browser* browser = chrome::FindOrCreateTabbedBrowser( |
| 73 chrome::FindOrCreateTabbedBrowser(profile, | 73 profile, |
| 74 chrome::HOST_DESKTOP_TYPE_ASH); | 74 chrome::HOST_DESKTOP_TYPE_ASH); |
| 75 if (GetBalloonExtension(balloon)) | 75 if (GetBalloonExtension(balloon)) |
| 76 chrome::ShowExtensions(browser); | 76 chrome::ShowExtensions(browser); |
| 77 else | 77 else |
| 78 chrome::ShowContentSettings(browser, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 78 chrome::ShowContentSettings(browser, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void BalloonCollectionImplAsh::OnClicked(const std::string& notification_id) { | 81 void BalloonCollectionImplAsh::OnClicked(const std::string& notification_id) { |
| 82 Balloon* balloon = base().FindBalloonById(notification_id); | 82 Balloon* balloon = base().FindBalloonById(notification_id); |
| 83 if (!balloon) | 83 if (!balloon) |
| 84 return; | 84 return; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return extension_service->extensions()->GetExtensionOrAppByURL( | 144 return extension_service->extensions()->GetExtensionOrAppByURL( |
| 145 ExtensionURLInfo(origin)); | 145 ExtensionURLInfo(origin)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
| 149 // static | 149 // static |
| 150 BalloonCollection* BalloonCollection::Create() { | 150 BalloonCollection* BalloonCollection::Create() { |
| 151 return new BalloonCollectionImplAsh(); | 151 return new BalloonCollectionImplAsh(); |
| 152 } | 152 } |
| 153 #endif | 153 #endif |
| OLD | NEW |