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

Unified Diff: chrome/browser/extensions/api/api_function.cc

Issue 11116016: Hook up API to notification_ui_manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asargent review suggestion Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/api_function.cc
diff --git a/chrome/browser/extensions/api/api_function.cc b/chrome/browser/extensions/api/api_function.cc
index 7bcbdc74450b2a33df7ee6ac16d8b17bf76b3cab..398b1392f6feb3b6f06d6e1e5ff8a9fe96485672 100644
--- a/chrome/browser/extensions/api/api_function.cc
+++ b/chrome/browser/extensions/api/api_function.cc
@@ -12,6 +12,29 @@ using content::BrowserThread;
namespace extensions {
+ApiFunction::ApiFunction() {
+}
+
+ApiFunction::~ApiFunction() {
+}
+
+int ApiFunction::ExtractSrcId(const DictionaryValue* options) {
+ int src_id = -1;
+ if (options) {
+ if (options->HasKey(kSrcIdKey))
+ EXTENSION_FUNCTION_VALIDATE(options->GetInteger(kSrcIdKey, &src_id));
+ }
+ return src_id;
+}
+
+ApiResourceEventNotifier* ApiFunction::CreateEventNotifier(int src_id) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return new ApiResourceEventNotifier(
+ profile()->GetExtensionEventRouter(), profile(), extension_id(),
+ src_id, source_url());
+}
+
+// AsyncApiFunction
AsyncApiFunction::AsyncApiFunction()
: work_thread_id_(BrowserThread::IO) {
}
@@ -69,20 +92,4 @@ void AsyncApiFunction::RespondOnUIThread() {
SendResponse(Respond());
}
-int AsyncApiFunction::ExtractSrcId(const DictionaryValue* options) {
- int src_id = -1;
- if (options) {
- if (options->HasKey(kSrcIdKey))
- EXTENSION_FUNCTION_VALIDATE(options->GetInteger(kSrcIdKey, &src_id));
- }
- return src_id;
-}
-
-ApiResourceEventNotifier* AsyncApiFunction::CreateEventNotifier(int src_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return new ApiResourceEventNotifier(
- profile()->GetExtensionEventRouter(), profile(), extension_id(),
- src_id, source_url());
-}
-
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/api/api_function.h ('k') | chrome/browser/extensions/api/notification/notification_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698