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

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

Issue 8294030: Fix snapshotting on linux by creating a separate automation path for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... 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
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 f610bcae3f830b6e2b74eda02c74d297b119ccb9..2c5b8cdef3b3e8c4ebbe555ed3c8085f2d1bc54d 100644
--- a/chrome/browser/automation/automation_provider_observers.h
+++ b/chrome/browser/automation/automation_provider_observers.h
@@ -1336,13 +1336,12 @@ class SavePackageNotificationObserver : public 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 NotificationObserver {
public:
PageSnapshotTaker(AutomationProvider* automation,
IPC::Message* reply_message,
- RenderViewHost* render_view,
+ TabContentsWrapper* tab_contents,
const FilePath& path);
virtual ~PageSnapshotTaker();
@@ -1350,26 +1349,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 NotificationSource& source,
+ const 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_;
+ NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker);
};

Powered by Google App Engine
This is Rietveld 408576698