OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_BROWSER_PLUGIN_CHROME_BROWSER_PLUGIN_GUEST_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_BROWSER_PLUGIN_CHROME_BROWSER_PLUGIN_GUEST_OBSERVER_H_ |
| 7 |
| 8 #include "content/public/browser/browser_plugin/browser_plugin_guest_observer.h" |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/extensions/script_executor.h" |
| 13 |
| 14 namespace base { |
| 15 class ListValue; |
| 16 } // namespace base |
| 17 |
| 18 namespace extensions { |
| 19 class Extension; |
| 20 } // namespace extensions |
| 21 |
| 22 class ChromeBrowserPluginGuestObserver |
| 23 : public content::BrowserPluginGuestObserver, |
| 24 public base::RefCounted<ChromeBrowserPluginGuestObserver> { |
| 25 public: |
| 26 explicit ChromeBrowserPluginGuestObserver(content::BrowserPluginGuest* guest); |
| 27 |
| 28 virtual bool OnMessageReceivedFromEmbedder( |
| 29 const IPC::Message& message) OVERRIDE; |
| 30 |
| 31 private: |
| 32 friend class base::RefCounted<ChromeBrowserPluginGuestObserver>; |
| 33 |
| 34 virtual ~ChromeBrowserPluginGuestObserver(); |
| 35 |
| 36 virtual void OnDestruct() OVERRIDE; |
| 37 |
| 38 // Message handlers. |
| 39 void OnExecuteScript(int instance_id, |
| 40 int request_id, |
| 41 const base::ListValue& list); |
| 42 void OnExecuteCodeFinished(int request_id, |
| 43 const std::string& error, |
| 44 int32 on_page_id, |
| 45 const GURL& on_url, |
| 46 const base::ListValue& script_result); |
| 47 |
| 48 ObserverList<extensions::TabHelper::ScriptExecutionObserver> |
| 49 script_observers_; |
| 50 scoped_ptr<extensions::ScriptExecutor> script_executor_; |
| 51 scoped_refptr<extensions::Extension> extension_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserPluginGuestObserver); |
| 54 }; |
| 55 |
| 56 #endif // CHROME_BROWSER_BROWSER_PLUGIN_CHROME_BROWSER_PLUGIN_GUEST_OBSERVER_H_ |
OLD | NEW |