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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.h

Issue 9950098: Fixed bug where the ExecuteJavascript() family of PyAuto hooks ignored the automation id of message… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Found a use where this change broke ExecuteJavascript, this should fix it. Created 8 years, 8 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 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 int active_match_ordinal_; 601 int active_match_ordinal_;
602 // Send reply using json automation interface. 602 // Send reply using json automation interface.
603 bool reply_with_json_; 603 bool reply_with_json_;
604 scoped_ptr<IPC::Message> reply_message_; 604 scoped_ptr<IPC::Message> reply_message_;
605 605
606 DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver); 606 DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver);
607 }; 607 };
608 608
609 class DomOperationObserver : public content::NotificationObserver { 609 class DomOperationObserver : public content::NotificationObserver {
610 public: 610 public:
611 DomOperationObserver(); 611 explicit DomOperationObserver(int automation_id);
612 virtual ~DomOperationObserver(); 612 virtual ~DomOperationObserver();
613 613
614 virtual void Observe(int type, 614 virtual void Observe(int type,
615 const content::NotificationSource& source, 615 const content::NotificationSource& source,
616 const content::NotificationDetails& details) OVERRIDE; 616 const content::NotificationDetails& details) OVERRIDE;
617 617
618 virtual void OnDomOperationCompleted(const std::string& json) = 0; 618 virtual void OnDomOperationCompleted(const std::string& json) = 0;
619 virtual void OnModalDialogShown() = 0; 619 virtual void OnModalDialogShown() = 0;
620 virtual void OnJavascriptBlocked() = 0; 620 virtual void OnJavascriptBlocked() = 0;
621 621
622 private: 622 private:
623 int automation_id_;
623 content::NotificationRegistrar registrar_; 624 content::NotificationRegistrar registrar_;
624 625
625 DISALLOW_COPY_AND_ASSIGN(DomOperationObserver); 626 DISALLOW_COPY_AND_ASSIGN(DomOperationObserver);
626 }; 627 };
627 628
628 // Sends a message back to the automation client with the results of the DOM 629 // Sends a message back to the automation client with the results of the DOM
629 // operation. 630 // operation.
630 class DomOperationMessageSender : public DomOperationObserver { 631 class DomOperationMessageSender : public DomOperationObserver {
631 public: 632 public:
632 DomOperationMessageSender(AutomationProvider* automation, 633 DomOperationMessageSender(AutomationProvider* automation,
633 IPC::Message* relpy_message, 634 IPC::Message* reply_message,
634 bool use_json_interface); 635 bool use_json_interface);
635 virtual ~DomOperationMessageSender(); 636 virtual ~DomOperationMessageSender();
636 637
637 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; 638 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE;
638 virtual void OnModalDialogShown() OVERRIDE; 639 virtual void OnModalDialogShown() OVERRIDE;
639 virtual void OnJavascriptBlocked() OVERRIDE; 640 virtual void OnJavascriptBlocked() OVERRIDE;
640 641
641 private: 642 private:
642 base::WeakPtr<AutomationProvider> automation_; 643 base::WeakPtr<AutomationProvider> automation_;
643 scoped_ptr<IPC::Message> reply_message_; 644 scoped_ptr<IPC::Message> reply_message_;
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 private: 1888 private:
1888 base::WeakPtr<AutomationProvider> automation_; 1889 base::WeakPtr<AutomationProvider> automation_;
1889 scoped_ptr<IPC::Message> reply_message_; 1890 scoped_ptr<IPC::Message> reply_message_;
1890 std::string extension_id_; 1891 std::string extension_id_;
1891 content::NotificationRegistrar registrar_; 1892 content::NotificationRegistrar registrar_;
1892 1893
1893 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); 1894 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver);
1894 }; 1895 };
1895 1896
1896 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 1897 #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