| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 85 balloon->OnClick(); | 85 balloon->OnClick(); |
| 86 RemoveById(notification_id); | |
| 87 } | 86 } |
| 88 | 87 |
| 89 void BalloonCollectionImplAsh::OnButtonClicked( | 88 void BalloonCollectionImplAsh::OnButtonClicked( |
| 90 const std::string& notification_id, int button_index) { | 89 const std::string& notification_id, int button_index) { |
| 91 Balloon* balloon = base().FindBalloonById(notification_id); | 90 Balloon* balloon = base().FindBalloonById(notification_id); |
| 92 if (balloon) | 91 if (balloon) |
| 93 balloon->OnButtonClick(button_index); | 92 balloon->OnButtonClick(button_index); |
| 94 } | 93 } |
| 95 | 94 |
| 96 bool BalloonCollectionImplAsh::AddWebUIMessageCallback( | 95 bool BalloonCollectionImplAsh::AddWebUIMessageCallback( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return extension_service->extensions()->GetExtensionOrAppByURL( | 144 return extension_service->extensions()->GetExtensionOrAppByURL( |
| 146 ExtensionURLInfo(origin)); | 145 ExtensionURLInfo(origin)); |
| 147 } | 146 } |
| 148 | 147 |
| 149 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
| 150 // static | 149 // static |
| 151 BalloonCollection* BalloonCollection::Create() { | 150 BalloonCollection* BalloonCollection::Create() { |
| 152 return new BalloonCollectionImplAsh(); | 151 return new BalloonCollectionImplAsh(); |
| 153 } | 152 } |
| 154 #endif | 153 #endif |
| OLD | NEW |