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

Unified Diff: chrome/browser/extensions/extension_function.h

Issue 150062: [chromium-reviews] Add getLanguage function to tabs extension (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/extension_function.h
===================================================================
--- chrome/browser/extensions/extension_function.h (revision 20334)
+++ chrome/browser/extensions/extension_function.h (working copy)
@@ -93,8 +93,15 @@
virtual void SetArgs(const std::string& args);
virtual const std::string GetResult();
virtual const std::string GetError() { return error_; }
- virtual void Run() = 0;
+ virtual void Run() {
+ if (!RunImpl())
+ SendResponse(false);
+ }
+ // Derived classes should implement this method to do their work and return
+ // success/failure.
+ virtual bool RunImpl() = 0;
+
protected:
void SendResponse(bool success);
@@ -107,7 +114,7 @@
Value* args_;
// The result of the API. This should be populated by the derived class before
- // Run() returns.
+ // SendResponse() is called.
scoped_ptr<Value> result_;
// Any detailed error from the API. This should be populated by the derived
Property changes on: chrome\browser\extensions\extension_function.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698