Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1779)

Side by Side Diff: chrome/browser/extensions/api/notification/notification_api.cc

Issue 11958025: Start delegating notifications to MessageCenter on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix androif build Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/notification/notification_api.h" 5 #include "chrome/browser/extensions/api/notification/notification_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 UTF8ToUTF16(i->get()->title)); 173 UTF8ToUTF16(i->get()->title));
174 item->SetString(ui::notifications::kItemMessageKey, 174 item->SetString(ui::notifications::kItemMessageKey,
175 UTF8ToUTF16(i->get()->message)); 175 UTF8ToUTF16(i->get()->message));
176 items->Append(item); 176 items->Append(item);
177 } 177 }
178 optional_fields->Set(ui::notifications::kItemsKey, items); 178 optional_fields->Set(ui::notifications::kItemsKey, items);
179 } 179 }
180 180
181 string16 replace_id(UTF8ToUTF16(options->replace_id)); 181 string16 replace_id(UTF8ToUTF16(options->replace_id));
182 182
183 Notification notification(type, icon_url, title, message, 183 Notification notification(type, extension_->url(), icon_url, title, message,
184 WebKit::WebTextDirectionDefault, 184 WebKit::WebTextDirectionDefault,
185 string16(), replace_id, 185 string16(), replace_id,
186 optional_fields.get(), 186 optional_fields.get(),
187 new NotificationApiDelegate(this, 187 new NotificationApiDelegate(this,
188 profile(), 188 profile(),
189 extension_->id(), 189 extension_->id(),
190 replace_id)); 190 replace_id));
191 g_browser_process->notification_ui_manager()->Add(notification, profile()); 191 g_browser_process->notification_ui_manager()->Add(notification, profile());
192 192
193 // TODO(miket): why return a result if it's always true? 193 // TODO(miket): why return a result if it's always true?
194 DictionaryValue* result = new DictionaryValue(); 194 DictionaryValue* result = new DictionaryValue();
195 result->SetBoolean(kResultKey, true); 195 result->SetBoolean(kResultKey, true);
196 SetResult(result); 196 SetResult(result);
197 SendResponse(true); 197 SendResponse(true);
198 198
199 return true; 199 return true;
200 } 200 }
201 201
202 } // namespace extensions 202 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698