OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlapp.h> | 9 #include <atlapp.h> |
10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 State(const CHARRANGE& selection, | 48 State(const CHARRANGE& selection, |
49 const CHARRANGE& saved_selection_for_focus_change) | 49 const CHARRANGE& saved_selection_for_focus_change) |
50 : selection(selection), | 50 : selection(selection), |
51 saved_selection_for_focus_change(saved_selection_for_focus_change) { | 51 saved_selection_for_focus_change(saved_selection_for_focus_change) { |
52 } | 52 } |
53 | 53 |
54 const CHARRANGE selection; | 54 const CHARRANGE selection; |
55 const CHARRANGE saved_selection_for_focus_change; | 55 const CHARRANGE saved_selection_for_focus_change; |
56 }; | 56 }; |
57 | 57 |
58 DECLARE_WND_CLASS(L"Chrome_OmniboxView"); | |
59 | |
60 OmniboxViewWin(OmniboxEditController* controller, | 58 OmniboxViewWin(OmniboxEditController* controller, |
61 ToolbarModel* toolbar_model, | 59 ToolbarModel* toolbar_model, |
62 LocationBarView* parent_view, | 60 LocationBarView* parent_view, |
63 CommandUpdater* command_updater, | 61 CommandUpdater* command_updater, |
64 bool popup_window_mode, | 62 bool popup_window_mode, |
65 views::View* location_bar, | 63 views::View* location_bar, |
66 views::View* popup_parent_view); | 64 views::View* popup_parent_view); |
67 ~OmniboxViewWin(); | 65 ~OmniboxViewWin(); |
68 | 66 |
| 67 // This is equivalent to DECLARE_WND_CLASS. |
| 68 static CWndClassInfo& GetWndClassInfo(); |
| 69 |
69 // Gets the relative window for the specified native view. | 70 // Gets the relative window for the specified native view. |
70 static gfx::NativeView GetRelativeWindowForNativeView( | 71 static gfx::NativeView GetRelativeWindowForNativeView( |
71 gfx::NativeView edit_native_view); | 72 gfx::NativeView edit_native_view); |
72 | 73 |
73 views::View* parent_view() const; | 74 views::View* parent_view() const; |
74 | 75 |
75 // OmniboxView: | 76 // OmniboxView: |
76 virtual void SaveStateToTab(content::WebContents* tab) OVERRIDE; | 77 virtual void SaveStateToTab(content::WebContents* tab) OVERRIDE; |
77 virtual void Update( | 78 virtual void Update( |
78 const content::WebContents* tab_for_state_restoring) OVERRIDE; | 79 const content::WebContents* tab_for_state_restoring) OVERRIDE; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 BEGIN_MSG_MAP(OmniboxViewWin) | 147 BEGIN_MSG_MAP(OmniboxViewWin) |
147 MSG_WM_CHAR(OnChar) | 148 MSG_WM_CHAR(OnChar) |
148 MSG_WM_CONTEXTMENU(OnContextMenu) | 149 MSG_WM_CONTEXTMENU(OnContextMenu) |
149 MSG_WM_COPY(OnCopy) | 150 MSG_WM_COPY(OnCopy) |
150 MSG_WM_CUT(OnCut) | 151 MSG_WM_CUT(OnCut) |
151 MESSAGE_HANDLER_EX(WM_GETOBJECT, OnGetObject) | 152 MESSAGE_HANDLER_EX(WM_GETOBJECT, OnGetObject) |
152 MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition) | 153 MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition) |
153 MESSAGE_HANDLER_EX(WM_IME_NOTIFY, OnImeNotify) | 154 MESSAGE_HANDLER_EX(WM_IME_NOTIFY, OnImeNotify) |
154 MESSAGE_HANDLER_EX(WM_POINTERDOWN, OnPointerDown) | 155 MESSAGE_HANDLER_EX(WM_POINTERDOWN, OnPointerDown) |
155 MESSAGE_HANDLER_EX(WM_POINTERUP, OnPointerUp) | 156 MESSAGE_HANDLER_EX(WM_POINTERUP, OnPointerUp) |
| 157 MSG_WM_CREATE(OnCreate) |
156 MSG_WM_KEYDOWN(OnKeyDown) | 158 MSG_WM_KEYDOWN(OnKeyDown) |
157 MSG_WM_KEYUP(OnKeyUp) | 159 MSG_WM_KEYUP(OnKeyUp) |
158 MSG_WM_KILLFOCUS(OnKillFocus) | 160 MSG_WM_KILLFOCUS(OnKillFocus) |
159 MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk) | 161 MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk) |
160 MSG_WM_LBUTTONDOWN(OnLButtonDown) | 162 MSG_WM_LBUTTONDOWN(OnLButtonDown) |
161 MSG_WM_LBUTTONUP(OnLButtonUp) | 163 MSG_WM_LBUTTONUP(OnLButtonUp) |
162 MSG_WM_MBUTTONDBLCLK(OnMButtonDblClk) | 164 MSG_WM_MBUTTONDBLCLK(OnMButtonDblClk) |
163 MSG_WM_MBUTTONDOWN(OnMButtonDown) | 165 MSG_WM_MBUTTONDOWN(OnMButtonDown) |
164 MSG_WM_MBUTTONUP(OnMButtonUp) | 166 MSG_WM_MBUTTONUP(OnMButtonUp) |
165 MSG_WM_MOUSEACTIVATE(OnMouseActivate) | 167 MSG_WM_MOUSEACTIVATE(OnMouseActivate) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 int num_bytes, | 240 int num_bytes, |
239 int action); | 241 int action); |
240 | 242 |
241 // Returns true if |edit_text| starting at |current_pos| is "://". | 243 // Returns true if |edit_text| starting at |current_pos| is "://". |
242 static bool SchemeEnd(LPTSTR edit_text, int current_pos, int length); | 244 static bool SchemeEnd(LPTSTR edit_text, int current_pos, int length); |
243 | 245 |
244 // Message handlers | 246 // Message handlers |
245 void OnChar(TCHAR ch, UINT repeat_count, UINT flags); | 247 void OnChar(TCHAR ch, UINT repeat_count, UINT flags); |
246 void OnContextMenu(HWND window, const CPoint& point); | 248 void OnContextMenu(HWND window, const CPoint& point); |
247 void OnCopy(); | 249 void OnCopy(); |
| 250 LRESULT OnCreate(const CREATESTRUCTW* create_struct); |
248 void OnCut(); | 251 void OnCut(); |
249 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam); | 252 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam); |
250 LRESULT OnImeComposition(UINT message, WPARAM wparam, LPARAM lparam); | 253 LRESULT OnImeComposition(UINT message, WPARAM wparam, LPARAM lparam); |
251 LRESULT OnImeNotify(UINT message, WPARAM wparam, LPARAM lparam); | 254 LRESULT OnImeNotify(UINT message, WPARAM wparam, LPARAM lparam); |
252 LRESULT OnPointerDown(UINT message, WPARAM wparam, LPARAM lparam); | 255 LRESULT OnPointerDown(UINT message, WPARAM wparam, LPARAM lparam); |
253 LRESULT OnPointerUp(UINT message, WPARAM wparam, LPARAM lparam); | 256 LRESULT OnPointerUp(UINT message, WPARAM wparam, LPARAM lparam); |
254 void OnKeyDown(TCHAR key, UINT repeat_count, UINT flags); | 257 void OnKeyDown(TCHAR key, UINT repeat_count, UINT flags); |
255 void OnKeyUp(TCHAR key, UINT repeat_count, UINT flags); | 258 void OnKeyUp(TCHAR key, UINT repeat_count, UINT flags); |
256 void OnKillFocus(HWND focus_wnd); | 259 void OnKillFocus(HWND focus_wnd); |
257 void OnLButtonDblClk(UINT keys, const CPoint& point); | 260 void OnLButtonDblClk(UINT keys, const CPoint& point); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // This contains the scheme char start and stop indexes that should be | 498 // This contains the scheme char start and stop indexes that should be |
496 // stricken-out when displaying an insecure scheme. | 499 // stricken-out when displaying an insecure scheme. |
497 url_parse::Component insecure_scheme_component_; | 500 url_parse::Component insecure_scheme_component_; |
498 | 501 |
499 // Instance of accessibility information and handling. | 502 // Instance of accessibility information and handling. |
500 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_; | 503 mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_; |
501 | 504 |
502 // The native view host. | 505 // The native view host. |
503 views::NativeViewHost* native_view_host_; | 506 views::NativeViewHost* native_view_host_; |
504 | 507 |
| 508 // Flag watching to load RichEdit dll. |
| 509 static bool did_load_library_; |
| 510 |
505 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); | 511 DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin); |
506 }; | 512 }; |
507 | 513 |
508 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ | 514 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_ |
OLD | NEW |