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

Unified Diff: ceee/ie/plugin/bho/infobar_manager.h

Issue 4991002: New unittests for infobar. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
Index: ceee/ie/plugin/bho/infobar_manager.h
===================================================================
--- ceee/ie/plugin/bho/infobar_manager.h (revision 66307)
+++ ceee/ie/plugin/bho/infobar_manager.h (working copy)
@@ -24,12 +24,12 @@
// Shows the infobar of the specified type and navigates it to the specified
// URL.
- HRESULT Show(InfobarType type, int max_height, const std::wstring& url,
- bool slide);
+ virtual HRESULT Show(InfobarType type, int max_height,
+ const std::wstring& url, bool slide);
// Hides the infobar of the specified type.
- HRESULT Hide(InfobarType type);
+ virtual HRESULT Hide(InfobarType type);
// Hides all infobars.
- void HideAll();
+ virtual void HideAll();
// Implementation of InfobarWindow::Delegate.
// Finds the handle of the container window.
@@ -37,14 +37,28 @@
// Informs about window.close() event.
virtual void OnWindowClose(InfobarType type);
- private:
+ protected:
class ContainerWindow;
+ class ContainerWindowInterface {
+ public:
+ virtual ~ContainerWindowInterface() {}
+ virtual bool IsDestroyed() const = 0;
+ virtual HWND GetWindowHandle() const = 0;
+ virtual bool PostWindowsMessage(UINT msg, WPARAM wparam, LPARAM lparam) = 0;
+ };
+ // Lazy initialization of InfobarWindow object.
+ void LazyInitialize(InfobarType type);
+
+ // Creates container window. Separated for the unit testing.
+ virtual ContainerWindowInterface* CreateContainerWindow(
+ HWND container, InfobarManager* manager);
+
// The HWND of the tab window the infobars are associated with.
HWND tab_window_;
// Parent window for IE content window.
- scoped_ptr<ContainerWindow> container_window_;
+ scoped_ptr<ContainerWindowInterface> container_window_;
// Infobar windows.
scoped_ptr<InfobarWindow> infobars_[END_OF_INFOBAR_TYPE];

Powered by Google App Engine
This is Rietveld 408576698