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

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

Issue 8672001: Revert 111252 - Switch MHTMLGenerationManager to use a Callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_save_page_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_save_page_api.h
===================================================================
--- chrome/browser/extensions/extension_save_page_api.h (revision 111255)
+++ chrome/browser/extensions/extension_save_page_api.h (working copy)
@@ -10,11 +10,12 @@
#include "base/memory/ref_counted.h"
#include "chrome/browser/extensions/extension_function.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "webkit/blob/deletable_file_reference.h"
-class FilePath;
-
-class SavePageAsMHTMLFunction : public AsyncExtensionFunction {
+class SavePageAsMHTMLFunction : public AsyncExtensionFunction,
+ public content::NotificationObserver {
public:
SavePageAsMHTMLFunction();
@@ -30,6 +31,9 @@
private:
virtual ~SavePageAsMHTMLFunction();
virtual bool RunImpl() OVERRIDE;
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
virtual bool OnMessageReceivedFromRenderView(
const IPC::Message& message) OVERRIDE;
@@ -41,9 +45,6 @@
void ReturnFailure(const std::string& error);
void ReturnSuccess(int64 file_size);
- // Callback called once the MHTML generation is done.
- void MHTMLGenerated(const FilePath& file_path, int64 mhtml_file_size);
-
// Returns the TabContents we are associated with, NULL if it's been closed.
TabContents* GetTabContents();
@@ -55,6 +56,8 @@
// The file containing the MHTML.
scoped_refptr<webkit_blob::DeletableFileReference> mhtml_file_;
+ content::NotificationRegistrar registrar_;
+
DECLARE_EXTENSION_FUNCTION_NAME("experimental.savePage.saveAsMHTML")
};
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_save_page_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698