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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 const content::NotificationDetails& details); 1336 const content::NotificationDetails& details);
1337 1337
1338 private: 1338 private:
1339 content::NotificationRegistrar registrar_; 1339 content::NotificationRegistrar registrar_;
1340 base::WeakPtr<AutomationProvider> automation_; 1340 base::WeakPtr<AutomationProvider> automation_;
1341 scoped_ptr<IPC::Message> reply_message_; 1341 scoped_ptr<IPC::Message> reply_message_;
1342 1342
1343 DISALLOW_COPY_AND_ASSIGN(SavePackageNotificationObserver); 1343 DISALLOW_COPY_AND_ASSIGN(SavePackageNotificationObserver);
1344 }; 1344 };
1345 1345
1346 // This class manages taking a snapshot of a page. This requires waiting on 1346 // This class manages taking a snapshot of a page.
1347 // asynchronous callbacks and notifications. 1347 class PageSnapshotTaker : public TabEventObserver,
1348 class PageSnapshotTaker : public DomOperationObserver { 1348 public content::NotificationObserver {
1349 public: 1349 public:
1350 PageSnapshotTaker(AutomationProvider* automation, 1350 PageSnapshotTaker(AutomationProvider* automation,
1351 IPC::Message* reply_message, 1351 IPC::Message* reply_message,
1352 RenderViewHost* render_view, 1352 TabContentsWrapper* tab_contents,
1353 const FilePath& path); 1353 const FilePath& path);
1354 virtual ~PageSnapshotTaker(); 1354 virtual ~PageSnapshotTaker();
1355 1355
1356 // Start the process of taking a snapshot of the entire page. 1356 // Start the process of taking a snapshot of the entire page.
1357 void Start(); 1357 void Start();
1358 1358
1359 private: 1359 private:
1360 // Overriden from DomOperationObserver. 1360 // TabEventObserver overrides.
1361 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; 1361 virtual void OnSnapshotEntirePageACK(
1362 virtual void OnModalDialogShown() OVERRIDE; 1362 bool success,
1363 1363 const std::vector<unsigned char>& png_data,
1364 // Called by the ThumbnailGenerator when the requested snapshot has been 1364 const std::string& error_msg) OVERRIDE;
1365 // generated. 1365 // NotificationObserver overrides.
1366 void OnSnapshotTaken(const SkBitmap& bitmap); 1366 virtual void Observe(int type,
1367 1367 const content::NotificationSource& source,
1368 // Helper method to send arbitrary javascript to the renderer for evaluation. 1368 const content::NotificationDetails& details);
1369 void ExecuteScript(const std::wstring& javascript);
1370 1369
1371 // Helper method to send a response back to the client. Deletes this. 1370 // Helper method to send a response back to the client. Deletes this.
1372 void SendMessage(bool success, const std::string& error_msg); 1371 void SendMessage(bool success, const std::string& error_msg);
1373 1372
1374 base::WeakPtr<AutomationProvider> automation_; 1373 base::WeakPtr<AutomationProvider> automation_;
1375 scoped_ptr<IPC::Message> reply_message_; 1374 scoped_ptr<IPC::Message> reply_message_;
1376 RenderViewHost* render_view_; 1375 TabContentsWrapper* tab_contents_;
1377 FilePath image_path_; 1376 FilePath image_path_;
1378 bool received_width_; 1377 content::NotificationRegistrar registrar_;
1379 gfx::Size entire_page_size_;
1380 1378
1381 DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker); 1379 DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker);
1382 }; 1380 };
1383 1381
1384 class NTPInfoObserver : public content::NotificationObserver { 1382 class NTPInfoObserver : public content::NotificationObserver {
1385 public: 1383 public:
1386 NTPInfoObserver(AutomationProvider* automation, 1384 NTPInfoObserver(AutomationProvider* automation,
1387 IPC::Message* reply_message, 1385 IPC::Message* reply_message,
1388 CancelableRequestConsumer* consumer); 1386 CancelableRequestConsumer* consumer);
1389 virtual ~NTPInfoObserver(); 1387 virtual ~NTPInfoObserver();
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 private: 1802 private:
1805 content::NotificationRegistrar registrar_; 1803 content::NotificationRegistrar registrar_;
1806 base::WeakPtr<AutomationProvider> automation_; 1804 base::WeakPtr<AutomationProvider> automation_;
1807 scoped_ptr<IPC::Message> reply_message_; 1805 scoped_ptr<IPC::Message> reply_message_;
1808 int new_window_id_; 1806 int new_window_id_;
1809 1807
1810 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); 1808 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver);
1811 }; 1809 };
1812 1810
1813 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 1811 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
OLDNEW
« 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