OLD | NEW |
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_FRAME_CHROME_FRAME_DELEGATE_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |
6 #define CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlwin.h> | 10 #include <atlwin.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 class ChromeFrameDelegate { | 37 class ChromeFrameDelegate { |
38 public: | 38 public: |
39 typedef HWND WindowType; | 39 typedef HWND WindowType; |
40 | 40 |
41 virtual WindowType GetWindow() const = 0; | 41 virtual WindowType GetWindow() const = 0; |
42 virtual void GetBounds(RECT* bounds) = 0; | 42 virtual void GetBounds(RECT* bounds) = 0; |
43 virtual std::string GetDocumentUrl() = 0; | 43 virtual std::string GetDocumentUrl() = 0; |
44 virtual void OnAutomationServerReady() = 0; | 44 virtual void OnAutomationServerReady() = 0; |
45 virtual void OnAutomationServerLaunchFailed( | 45 virtual void OnAutomationServerLaunchFailed( |
46 AutomationLaunchResult reason, const std::string& server_version) = 0; | 46 AutomationLaunchResult reason, const std::string& server_version) = 0; |
47 virtual void OnExtensionInstalled( | |
48 const FilePath& path, | |
49 void* user_data, | |
50 AutomationMsg_ExtensionResponseValues response) = 0; | |
51 virtual void OnGetEnabledExtensionsComplete( | |
52 void* user_data, | |
53 const std::vector<FilePath>& extension_directories) = 0; | |
54 virtual bool OnMessageReceived(const IPC::Message& msg) = 0; | 47 virtual bool OnMessageReceived(const IPC::Message& msg) = 0; |
55 virtual void OnChannelError() = 0; | 48 virtual void OnChannelError() = 0; |
56 | 49 |
57 // This remains in interface since we call it if Navigate() | 50 // This remains in interface since we call it if Navigate() |
58 // returns immediate error. | 51 // returns immediate error. |
59 virtual void OnLoadFailed(int error_code, const std::string& url) = 0; | 52 virtual void OnLoadFailed(int error_code, const std::string& url) = 0; |
60 | 53 |
61 // Returns true if this instance is alive and well for processing automation | 54 // Returns true if this instance is alive and well for processing automation |
62 // messages. | 55 // messages. |
63 virtual bool IsValid() const = 0; | 56 virtual bool IsValid() const = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
77 extern UINT kMessageFromChromeFrame; | 70 extern UINT kMessageFromChromeFrame; |
78 | 71 |
79 class ChromeFrameDelegateImpl : public ChromeFrameDelegate { | 72 class ChromeFrameDelegateImpl : public ChromeFrameDelegate { |
80 public: | 73 public: |
81 virtual WindowType GetWindow() { return NULL; } | 74 virtual WindowType GetWindow() { return NULL; } |
82 virtual void GetBounds(RECT* bounds) {} | 75 virtual void GetBounds(RECT* bounds) {} |
83 virtual std::string GetDocumentUrl() { return std::string(); } | 76 virtual std::string GetDocumentUrl() { return std::string(); } |
84 virtual void OnAutomationServerReady() {} | 77 virtual void OnAutomationServerReady() {} |
85 virtual void OnAutomationServerLaunchFailed( | 78 virtual void OnAutomationServerLaunchFailed( |
86 AutomationLaunchResult reason, const std::string& server_version) {} | 79 AutomationLaunchResult reason, const std::string& server_version) {} |
87 virtual void OnExtensionInstalled( | |
88 const FilePath& path, | |
89 void* user_data, | |
90 AutomationMsg_ExtensionResponseValues response) {} | |
91 virtual void OnGetEnabledExtensionsComplete( | |
92 void* user_data, | |
93 const std::vector<FilePath>& extension_directories) {} | |
94 virtual void OnLoadFailed(int error_code, const std::string& url) {} | 80 virtual void OnLoadFailed(int error_code, const std::string& url) {} |
95 virtual bool OnMessageReceived(const IPC::Message& msg); | 81 virtual bool OnMessageReceived(const IPC::Message& msg); |
96 virtual void OnChannelError() {} | 82 virtual void OnChannelError() {} |
97 | 83 |
98 static bool IsTabMessage(const IPC::Message& message); | 84 static bool IsTabMessage(const IPC::Message& message); |
99 | 85 |
100 virtual bool IsValid() const { | 86 virtual bool IsValid() const { |
101 return true; | 87 return true; |
102 } | 88 } |
103 | 89 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 } | 201 } |
216 | 202 |
217 return false; | 203 return false; |
218 } | 204 } |
219 | 205 |
220 base::Lock lock_; | 206 base::Lock lock_; |
221 std::queue<Task*> pending_tasks_; | 207 std::queue<Task*> pending_tasks_; |
222 }; | 208 }; |
223 | 209 |
224 #endif // CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ | 210 #endif // CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |
OLD | NEW |