| 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/extensions/extension_app_api.h" | 5 #include "chrome/browser/extensions/extension_app_api.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 if (!details->HasKey(kLinkTextKey)) { | 117 if (!details->HasKey(kLinkTextKey)) { |
| 118 error_ = kMissingLinkTextError; | 118 error_ = kMissingLinkTextError; |
| 119 return false; | 119 return false; |
| 120 } | 120 } |
| 121 EXTENSION_FUNCTION_VALIDATE(details->GetString(kLinkTextKey, | 121 EXTENSION_FUNCTION_VALIDATE(details->GetString(kLinkTextKey, |
| 122 &item->linkText)); | 122 &item->linkText)); |
| 123 } | 123 } |
| 124 | 124 |
| 125 if (details->HasKey(kIconDataKey)) { | 125 if (details->HasKey(kIconDataKey)) { |
| 126 BinaryValue* binary = NULL; | 126 base::BinaryValue* binary = NULL; |
| 127 EXTENSION_FUNCTION_VALIDATE(details->GetBinary(kIconDataKey, &binary)); | 127 EXTENSION_FUNCTION_VALIDATE(details->GetBinary(kIconDataKey, &binary)); |
| 128 IPC::Message bitmap_pickle(binary->GetBuffer(), binary->GetSize()); | 128 IPC::Message bitmap_pickle(binary->GetBuffer(), binary->GetSize()); |
| 129 void* iter = NULL; | 129 void* iter = NULL; |
| 130 SkBitmap bitmap; | 130 SkBitmap bitmap; |
| 131 EXTENSION_FUNCTION_VALIDATE( | 131 EXTENSION_FUNCTION_VALIDATE( |
| 132 IPC::ReadParam(&bitmap_pickle, &iter, &bitmap)); | 132 IPC::ReadParam(&bitmap_pickle, &iter, &bitmap)); |
| 133 // TODO(asargent) - use the bitmap to set the NTP icon! | 133 // TODO(asargent) - use the bitmap to set the NTP icon! |
| 134 } | 134 } |
| 135 | 135 |
| 136 AppNotificationManager* manager = | 136 AppNotificationManager* manager = |
| (...skipping 22 matching lines...) Expand all Loading... |
| 159 | 159 |
| 160 AppNotificationManager* manager = | 160 AppNotificationManager* manager = |
| 161 profile()->GetExtensionService()->app_notification_manager(); | 161 profile()->GetExtensionService()->app_notification_manager(); |
| 162 manager->ClearAll(id); | 162 manager->ClearAll(id); |
| 163 NotificationService::current()->Notify( | 163 NotificationService::current()->Notify( |
| 164 chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED, | 164 chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED, |
| 165 Source<Profile>(profile_), | 165 Source<Profile>(profile_), |
| 166 Details<const std::string>(&id)); | 166 Details<const std::string>(&id)); |
| 167 return true; | 167 return true; |
| 168 } | 168 } |
| OLD | NEW |