Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // IE toolband implementation. | 5 // IE toolband implementation. |
| 6 #ifndef CEEE_IE_PLUGIN_TOOLBAND_TOOL_BAND_H_ | 6 #ifndef CEEE_IE_PLUGIN_TOOLBAND_TOOL_BAND_H_ |
| 7 #define CEEE_IE_PLUGIN_TOOLBAND_TOOL_BAND_H_ | 7 #define CEEE_IE_PLUGIN_TOOLBAND_TOOL_BAND_H_ |
| 8 | 8 |
| 9 #include <atlbase.h> | 9 #include <atlbase.h> |
| 10 #include <atlapp.h> // Must be included AFTER base. | 10 #include <atlapp.h> // Must be included AFTER base. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 public IChromeFramePrivileged, | 48 public IChromeFramePrivileged, |
| 49 public IDeskBand, | 49 public IDeskBand, |
| 50 public IPersistStream, | 50 public IPersistStream, |
| 51 public ChromeFrameEvents, | 51 public ChromeFrameEvents, |
| 52 public HostingBrowserEvents, | 52 public HostingBrowserEvents, |
| 53 public CWindowImpl<ToolBand> { | 53 public CWindowImpl<ToolBand> { |
| 54 public: | 54 public: |
| 55 ToolBand(); | 55 ToolBand(); |
| 56 ~ToolBand(); | 56 ~ToolBand(); |
| 57 | 57 |
| 58 DECLARE_WND_SUPERCLASS(NULL, TOOLBARCLASSNAME) | |
|
Sigurður Ásgeirsson
2011/01/13 14:42:55
Why do we want this class name? Can you add a quic
Vitaly Buka (NO REVIEWS)
2011/01/14 00:06:30
Done.
| |
| 59 | |
| 58 DECLARE_REGISTRY_RESOURCEID_EX(IDR_TOOL_BAND) | 60 DECLARE_REGISTRY_RESOURCEID_EX(IDR_TOOL_BAND) |
| 59 BEGIN_REGISTRY_MAP(ToolBand) | 61 BEGIN_REGISTRY_MAP(ToolBand) |
| 60 REGMAP_UUID("CLSID", CLSID_ToolBand) | 62 REGMAP_UUID("CLSID", CLSID_ToolBand) |
| 61 REGMAP_RESOURCE("NAME", IDS_CEEE_NAME) | 63 REGMAP_RESOURCE("NAME", IDS_CEEE_NAME) |
| 62 END_REGISTRY_MAP() | 64 END_REGISTRY_MAP() |
| 63 | 65 |
| 64 BEGIN_COM_MAP(ToolBand) | 66 BEGIN_COM_MAP(ToolBand) |
| 65 COM_INTERFACE_ENTRY(IDeskBand) | 67 COM_INTERFACE_ENTRY(IDeskBand) |
| 66 COM_INTERFACE_ENTRY(IDockingWindow) | 68 COM_INTERFACE_ENTRY(IDockingWindow) |
| 67 COM_INTERFACE_ENTRY(IOleWindow) | 69 COM_INTERFACE_ENTRY(IOleWindow) |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 virtual void OnFinalMessage(HWND window); | 174 virtual void OnFinalMessage(HWND window); |
| 173 LRESULT OnCreate(LPCREATESTRUCT lpCreateStruct); | 175 LRESULT OnCreate(LPCREATESTRUCT lpCreateStruct); |
| 174 | 176 |
| 175 // Loads the manifest from file and retrieves the URL to the extension. | 177 // Loads the manifest from file and retrieves the URL to the extension. |
| 176 // @returns true on success, false on failure to read the manifest or URL. | 178 // @returns true on success, false on failure to read the manifest or URL. |
| 177 bool LoadManifestFile(const std::wstring& base_dir, | 179 bool LoadManifestFile(const std::wstring& base_dir, |
| 178 std::string* toolband_url); | 180 std::string* toolband_url); |
| 179 | 181 |
| 180 // @name Message handlers. | 182 // @name Message handlers. |
| 181 // @{ | 183 // @{ |
| 182 void OnPaint(CDCHandle dc); | |
| 183 void OnSize(UINT type, CSize size); | 184 void OnSize(UINT type, CSize size); |
| 184 // @} | 185 // @} |
| 185 | 186 |
| 186 // Toolband requires a specific BHO to work. Normally, IE will create BHO | 187 // Toolband requires a specific BHO to work. Normally, IE will create BHO |
| 187 // about the same time as the toolband. However, in some scenarios | 188 // about the same time as the toolband. However, in some scenarios |
| 188 // (re-enabling the gadget) BHOs for the current pages won't be created, | 189 // (re-enabling the gadget) BHOs for the current pages won't be created, |
| 189 // even though the bar will. | 190 // even though the bar will. |
| 190 HRESULT EnsureBhoIsAvailable(); | 191 HRESULT EnsureBhoIsAvailable(); |
| 191 | 192 |
| 192 // Gets the session ID of the Chrome Frame instance associated with the tool | 193 // Gets the session ID of the Chrome Frame instance associated with the tool |
| 193 // band. | 194 // band. |
| 194 virtual HRESULT GetSessionId(int* session_id); | 195 virtual HRESULT GetSessionId(int* session_id); |
| 195 | 196 |
| 196 // Sends the tool band's Chrome Frame session ID to the BHO, given the BHO as | 197 // Sends the tool band's Chrome Frame session ID to the BHO, given the BHO as |
| 197 // an IUnknown. | 198 // an IUnknown. |
| 198 virtual HRESULT SendSessionIdToBho(IUnknown* bho); | 199 virtual HRESULT SendSessionIdToBho(IUnknown* bho); |
| 199 | 200 |
| 200 private: | 201 private: |
| 202 class EmptyWindow : public CWindowImpl<EmptyWindow> { | |
| 203 public: | |
| 204 BEGIN_MSG_MAP(EmptyWindow) | |
| 205 END_MSG_MAP() | |
| 206 }; | |
| 207 | |
| 201 // Initializes the toolband to the given site. | 208 // Initializes the toolband to the given site. |
| 202 // Called from SetSite. | 209 // Called from SetSite. |
| 203 HRESULT Initialize(IUnknown *site); | 210 HRESULT Initialize(IUnknown *site); |
| 204 // Tears down an initialized toolband. | 211 // Tears down an initialized toolband. |
| 205 // Called from SetSite. | 212 // Called from SetSite. |
| 206 HRESULT Teardown(); | 213 HRESULT Teardown(); |
| 207 | 214 |
| 208 // Handles the dispatching of command received from the User/UI context. | 215 // Handles the dispatching of command received from the User/UI context. |
| 209 HRESULT DispatchUserCommand(const DictionaryValue& dict, | 216 HRESULT DispatchUserCommand(const DictionaryValue& dict, |
| 210 scoped_ptr<Value>* return_value); | 217 scoped_ptr<Value>* return_value); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 233 | 240 |
| 234 // The minimum size the toolband should take. | 241 // The minimum size the toolband should take. |
| 235 LONG current_width_; | 242 LONG current_width_; |
| 236 LONG current_height_; | 243 LONG current_height_; |
| 237 | 244 |
| 238 // The URL to our extension. | 245 // The URL to our extension. |
| 239 std::string extension_url_; | 246 std::string extension_url_; |
| 240 | 247 |
| 241 // Our Chrome frame instance and its window. | 248 // Our Chrome frame instance and its window. |
| 242 CComPtr<IChromeFrame> chrome_frame_; | 249 CComPtr<IChromeFrame> chrome_frame_; |
| 243 CWindow chrome_frame_window_; | 250 |
| 251 // Hides chrome frame during initialization. | |
| 252 EmptyWindow chrome_frame_container_window_; | |
| 244 | 253 |
| 245 // Indicates whether CloseDW() is being called on this tool band. | 254 // Indicates whether CloseDW() is being called on this tool band. |
| 246 bool is_quitting_; | 255 bool is_quitting_; |
| 247 | 256 |
| 248 // True if we noticed that no extensions are enabled and requested | 257 // True if we noticed that no extensions are enabled and requested |
| 249 // to install one. | 258 // to install one. |
| 250 bool already_tried_installing_; | 259 bool already_tried_installing_; |
| 251 | 260 |
| 252 // Flag purpose: see comments to ShouldForceOwnLine | 261 // Flag purpose: see comments to ShouldForceOwnLine |
| 253 // for efficiency we read only once (thus the second flag). | 262 // for efficiency we read only once (thus the second flag). |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 272 static _ATL_FUNC_INFO handler_type_long_; | 281 static _ATL_FUNC_INFO handler_type_long_; |
| 273 static _ATL_FUNC_INFO handler_type_idispatch_bstr_; | 282 static _ATL_FUNC_INFO handler_type_idispatch_bstr_; |
| 274 static _ATL_FUNC_INFO handler_type_bstr_i4_; | 283 static _ATL_FUNC_INFO handler_type_bstr_i4_; |
| 275 static _ATL_FUNC_INFO handler_type_bstrarray_; | 284 static _ATL_FUNC_INFO handler_type_bstrarray_; |
| 276 static _ATL_FUNC_INFO handler_type_idispatch_variantref_; | 285 static _ATL_FUNC_INFO handler_type_idispatch_variantref_; |
| 277 | 286 |
| 278 DISALLOW_COPY_AND_ASSIGN(ToolBand); | 287 DISALLOW_COPY_AND_ASSIGN(ToolBand); |
| 279 }; | 288 }; |
| 280 | 289 |
| 281 #endif // CEEE_IE_PLUGIN_TOOLBAND_TOOL_BAND_H_ | 290 #endif // CEEE_IE_PLUGIN_TOOLBAND_TOOL_BAND_H_ |
| OLD | NEW |