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

Side by Side Diff: ceee/ie/plugin/bho/infobar_window.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // @file 5 // @file
6 // Infobar window. 6 // Infobar window.
7 7
8 #ifndef CEEE_IE_PLUGIN_BHO_INFOBAR_WINDOW_H_ 8 #ifndef CEEE_IE_PLUGIN_BHO_INFOBAR_WINDOW_H_
9 #define CEEE_IE_PLUGIN_BHO_INFOBAR_WINDOW_H_ 9 #define CEEE_IE_PLUGIN_BHO_INFOBAR_WINDOW_H_
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Implementation of InfobarBrowserWindow::Delegate. 48 // Implementation of InfobarBrowserWindow::Delegate.
49 // Informs about window.close() event. 49 // Informs about window.close() event.
50 virtual void OnBrowserWindowClose(); 50 virtual void OnBrowserWindowClose();
51 51
52 // Shows the infobar. 52 // Shows the infobar.
53 // NOTE: Navigate should be called before Show. 53 // NOTE: Navigate should be called before Show.
54 // The height of the infobar is calculated to fit the content (limited to 54 // The height of the infobar is calculated to fit the content (limited to
55 // max_height if the content is too high; no limit if max_height is set to 55 // max_height if the content is too high; no limit if max_height is set to
56 // 0). 56 // 0).
57 // slide indicates whether to show sliding effect. 57 // slide indicates whether to show sliding effect.
58 HRESULT Show(int max_height, bool slide); 58 virtual HRESULT Show(int max_height, bool slide);
59 59
60 // Hides the infobar. 60 // Hides the infobar.
61 HRESULT Hide(); 61 virtual HRESULT Hide();
62 62
63 // Navigates the HTML view of the infobar. 63 // Navigates the HTML view of the infobar.
64 HRESULT Navigate(const std::wstring& url); 64 virtual HRESULT Navigate(const std::wstring& url);
65 65
66 // Reserves space for the infobar when IE window recalculates its size. 66 // Reserves space for the infobar when IE window recalculates its size.
67 void ReserveSpace(RECT* rect); 67 void ReserveSpace(RECT* rect);
68 68
69 // Updates the infobar size and position when IE content window size or 69 // Updates the infobar size and position when IE content window size or
70 // position is changed. 70 // position is changed.
71 void UpdatePosition(); 71 void UpdatePosition();
72 72
73 // Destroys the browser window. 73 // Destroys the browser window.
74 void Reset(); 74 virtual void Reset();
75
76 virtual HWND InternalCreate(HWND parent_window, DWORD style) {
77 return Create(parent_window, NULL, NULL, style);
78 }
75 79
76 private: 80 private:
77 BEGIN_MSG_MAP(InfobarWindow) 81 BEGIN_MSG_MAP(InfobarWindow)
78 MSG_WM_TIMER(OnTimer); 82 MSG_WM_TIMER(OnTimer);
79 MSG_WM_CREATE(OnCreate) 83 MSG_WM_CREATE(OnCreate)
80 MSG_WM_PAINT(OnPaint) 84 MSG_WM_PAINT(OnPaint)
81 MSG_WM_SIZE(OnSize) 85 MSG_WM_SIZE(OnSize)
82 END_MSG_MAP() 86 END_MSG_MAP()
83 87
84 // Type of the infobar - whether it is displayed at the top or at the bottom 88 // Type of the infobar - whether it is displayed at the top or at the bottom
(...skipping 11 matching lines...) Expand all
96 100
97 // The target height of the infobar. 101 // The target height of the infobar.
98 int target_height_; 102 int target_height_;
99 103
100 // The current height of the infobar. 104 // The current height of the infobar.
101 int current_height_; 105 int current_height_;
102 106
103 // Indicates whether the infobar is sliding. 107 // Indicates whether the infobar is sliding.
104 bool sliding_infobar_; 108 bool sliding_infobar_;
105 109
110 // Timer id when sliding the infobar.
111 UINT_PTR timer_id_;
112
106 // The Chrome Frame host handling a Chrome Frame instance for us. 113 // The Chrome Frame host handling a Chrome Frame instance for us.
107 CComPtr<IInfobarBrowserWindow> chrome_frame_host_; 114 CComPtr<IInfobarBrowserWindow> chrome_frame_host_;
108 115
109 // Constructor. 116 // Constructor.
110 InfobarWindow(InfobarType type, Delegate* delegate); 117 InfobarWindow(InfobarType type, Delegate* delegate);
111 118
112 // If show is true, shrinks IE content window and shows the infobar 119 // If show is true, shrinks IE content window and shows the infobar
113 // either at the top or at the bottom. Otherwise, hides the infobar and 120 // either at the top or at the bottom. Otherwise, hides the infobar and
114 // restores IE content window. 121 // restores IE content window.
115 void StartUpdatingLayout(bool show, int max_height, bool slide); 122 void StartUpdatingLayout(bool show, int max_height, bool slide);
(...skipping 18 matching lines...) Expand all
134 void OnSize(UINT type, CSize size); 141 void OnSize(UINT type, CSize size);
135 142
136 void AdjustSize(); 143 void AdjustSize();
137 144
138 DISALLOW_COPY_AND_ASSIGN(InfobarWindow); 145 DISALLOW_COPY_AND_ASSIGN(InfobarWindow);
139 }; 146 };
140 147
141 } // namespace infobar_api 148 } // namespace infobar_api
142 149
143 #endif // CEEE_IE_PLUGIN_BHO_INFOBAR_WINDOW_H_ 150 #endif // CEEE_IE_PLUGIN_BHO_INFOBAR_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698