| 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/extensions/api/app/app_api.h" | 5 #include "chrome/browser/extensions/api/app/app_api.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "chrome/browser/extensions/app_notification_manager.h" | 9 #include "chrome/browser/extensions/app_notification_manager.h" |
| 10 #include "chrome/browser/extensions/extension_event_router.h" | 10 #include "chrome/browser/extensions/extension_event_router.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 std::string link_text; | 80 std::string link_text; |
| 81 EXTENSION_FUNCTION_VALIDATE(details->GetString(kLinkTextKey, | 81 EXTENSION_FUNCTION_VALIDATE(details->GetString(kLinkTextKey, |
| 82 &link_text)); | 82 &link_text)); |
| 83 item->set_link_text(link_text); | 83 item->set_link_text(link_text); |
| 84 } | 84 } |
| 85 | 85 |
| 86 AppNotificationManager* manager = | 86 AppNotificationManager* manager = |
| 87 profile()->GetExtensionService()->app_notification_manager(); | 87 profile()->GetExtensionService()->app_notification_manager(); |
| 88 | 88 |
| 89 // TODO(beaudoin) We should probably report an error if Add returns false. |
| 89 manager->Add(item.release()); | 90 manager->Add(item.release()); |
| 90 | 91 |
| 91 return true; | 92 return true; |
| 92 } | 93 } |
| 93 | 94 |
| 94 bool AppClearAllNotificationsFunction::RunImpl() { | 95 bool AppClearAllNotificationsFunction::RunImpl() { |
| 95 if (!include_incognito() && profile_->IsOffTheRecord()) { | 96 if (!include_incognito() && profile_->IsOffTheRecord()) { |
| 96 error_ = extension_misc::kAppNotificationsIncognitoError; | 97 error_ = extension_misc::kAppNotificationsIncognitoError; |
| 97 return false; | 98 return false; |
| 98 } | 99 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 114 } | 115 } |
| 115 | 116 |
| 116 // static. | 117 // static. |
| 117 void AppEventRouter::DispatchOnLaunchedEvent( | 118 void AppEventRouter::DispatchOnLaunchedEvent( |
| 118 Profile* profile, const Extension* extension) { | 119 Profile* profile, const Extension* extension) { |
| 119 profile->GetExtensionEventRouter()->DispatchEventToExtension( | 120 profile->GetExtensionEventRouter()->DispatchEventToExtension( |
| 120 extension->id(), kOnLaunchedEvent, "[]", NULL, GURL()); | 121 extension->id(), kOnLaunchedEvent, "[]", NULL, GURL()); |
| 121 } | 122 } |
| 122 | 123 |
| 123 } // namespace extensions | 124 } // namespace extensions |
| OLD | NEW |