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

Side by Side Diff: chrome/browser/extensions/api/app/app_api.cc

Issue 10391034: Scaffolding for an experimental discovery API letting users inject links in the recommended pane of… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Answered review comments from PatchSet 4. Created 8 years, 7 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/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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/README.txt ('k') | chrome/browser/extensions/api/discovery/discovery_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698