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

Unified Diff: chrome/browser/automation/automation_provider_observers.h

Issue 8416024: Re-land 107645 with static initializers removed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove static initializers Created 9 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
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider_observers.h
diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h
index d92b73a867cf25a9b58e9ee84256d22e35d40c9f..ad51f80d710dd429865de93150cf44f2dcb2afc3 100644
--- a/chrome/browser/automation/automation_provider_observers.h
+++ b/chrome/browser/automation/automation_provider_observers.h
@@ -1343,13 +1343,13 @@ class SavePackageNotificationObserver : public content::NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(SavePackageNotificationObserver);
};
-// This class manages taking a snapshot of a page. This requires waiting on
-// asynchronous callbacks and notifications.
-class PageSnapshotTaker : public DomOperationObserver {
+// This class manages taking a snapshot of a page.
+class PageSnapshotTaker : public TabEventObserver,
+ public content::NotificationObserver {
public:
PageSnapshotTaker(AutomationProvider* automation,
IPC::Message* reply_message,
- RenderViewHost* render_view,
+ TabContentsWrapper* tab_contents,
const FilePath& path);
virtual ~PageSnapshotTaker();
@@ -1357,26 +1357,24 @@ class PageSnapshotTaker : public DomOperationObserver {
void Start();
private:
- // Overriden from DomOperationObserver.
- virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE;
- virtual void OnModalDialogShown() OVERRIDE;
-
- // Called by the ThumbnailGenerator when the requested snapshot has been
- // generated.
- void OnSnapshotTaken(const SkBitmap& bitmap);
-
- // Helper method to send arbitrary javascript to the renderer for evaluation.
- void ExecuteScript(const std::wstring& javascript);
+ // TabEventObserver overrides.
+ virtual void OnSnapshotEntirePageACK(
+ bool success,
+ const std::vector<unsigned char>& png_data,
+ const std::string& error_msg) OVERRIDE;
+ // NotificationObserver overrides.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
// Helper method to send a response back to the client. Deletes this.
void SendMessage(bool success, const std::string& error_msg);
base::WeakPtr<AutomationProvider> automation_;
scoped_ptr<IPC::Message> reply_message_;
- RenderViewHost* render_view_;
+ TabContentsWrapper* tab_contents_;
FilePath image_path_;
- bool received_width_;
- gfx::Size entire_page_size_;
+ content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker);
};
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698