OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_EXTERNAL_TAB_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H_ |
6 #define CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H_ | 6 #define CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_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 21 matching lines...) Expand all Loading... |
32 public NotificationObserver, | 32 public NotificationObserver, |
33 public views::Widget, | 33 public views::Widget, |
34 public views::KeystrokeListener, | 34 public views::KeystrokeListener, |
35 public CWindowImpl<ExternalTabContainer, | 35 public CWindowImpl<ExternalTabContainer, |
36 CWindow, | 36 CWindow, |
37 CWinTraits<WS_POPUP | | 37 CWinTraits<WS_POPUP | |
38 WS_CLIPCHILDREN>> { | 38 WS_CLIPCHILDREN>> { |
39 public: | 39 public: |
40 BEGIN_MSG_MAP(ExternalTabContainer) | 40 BEGIN_MSG_MAP(ExternalTabContainer) |
41 MESSAGE_HANDLER(WM_SIZE, OnSize) | 41 MESSAGE_HANDLER(WM_SIZE, OnSize) |
42 MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus) | |
43 MSG_WM_DESTROY(OnDestroy) | 42 MSG_WM_DESTROY(OnDestroy) |
44 END_MSG_MAP() | 43 END_MSG_MAP() |
45 | 44 |
46 DECLARE_WND_CLASS(chrome::kExternalTabWindowClass) | 45 DECLARE_WND_CLASS(chrome::kExternalTabWindowClass) |
47 | 46 |
48 ExternalTabContainer(AutomationProvider* automation); | 47 ExternalTabContainer(AutomationProvider* automation); |
49 ~ExternalTabContainer(); | 48 ~ExternalTabContainer(); |
50 | 49 |
51 TabContents* tab_contents() const { | 50 TabContents* tab_contents() const { |
52 return tab_contents_; | 51 return tab_contents_; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 virtual bool ProcessKeyDown(HWND window, UINT message, WPARAM wparam, | 107 virtual bool ProcessKeyDown(HWND window, UINT message, WPARAM wparam, |
109 LPARAM lparam); | 108 LPARAM lparam); |
110 | 109 |
111 // Sets the keyboard accelerators needed by the external host | 110 // Sets the keyboard accelerators needed by the external host |
112 void SetAccelerators(HACCEL accel_table, int accel_table_entry_count); | 111 void SetAccelerators(HACCEL accel_table, int accel_table_entry_count); |
113 | 112 |
114 // This is invoked when the external host reflects back to us a keyboard | 113 // This is invoked when the external host reflects back to us a keyboard |
115 // message it did not process | 114 // message it did not process |
116 void ProcessUnhandledAccelerator(const MSG& msg); | 115 void ProcessUnhandledAccelerator(const MSG& msg); |
117 | 116 |
118 // See TabContents::SetInitialFocus | |
119 void SetInitialFocus(bool reverse); | |
120 | |
121 // A helper method that tests whether the given window is an | 117 // A helper method that tests whether the given window is an |
122 // ExternalTabContainer window | 118 // ExternalTabContainer window |
123 static bool IsExternalTabContainer(HWND window); | 119 static bool IsExternalTabContainer(HWND window); |
124 | 120 |
125 // A helper method that retrieves the ExternalTabContainer object that | 121 // A helper method that retrieves the ExternalTabContainer object that |
126 // hosts the given tab window. | 122 // hosts the given tab window. |
127 static ExternalTabContainer* GetContainerForTab(HWND tab_window); | 123 static ExternalTabContainer* GetContainerForTab(HWND tab_window); |
128 | 124 |
129 protected: | 125 protected: |
130 LRESULT OnSize(UINT, WPARAM, LPARAM, BOOL& handled); | 126 LRESULT OnSize(UINT, WPARAM, LPARAM, BOOL& handled); |
131 LRESULT OnSetFocus(UINT msg, WPARAM wp, LPARAM lp, BOOL& handled); | |
132 | |
133 void OnDestroy(); | 127 void OnDestroy(); |
134 void OnFinalMessage(HWND window); | 128 void OnFinalMessage(HWND window); |
135 | 129 |
136 protected: | 130 protected: |
137 TabContents* tab_contents_; | 131 TabContents *tab_contents_; |
138 AutomationProvider* automation_; | 132 AutomationProvider* automation_; |
139 | 133 |
140 NotificationRegistrar registrar_; | 134 NotificationRegistrar registrar_; |
141 | 135 |
142 // Root view | 136 // Root view |
143 views::RootView root_view_; | 137 views::RootView root_view_; |
144 // The accelerator table of the external host. | 138 // The accelerator table of the external host. |
145 HACCEL external_accel_table_; | 139 HACCEL external_accel_table_; |
146 unsigned int external_accel_entry_count_; | 140 unsigned int external_accel_entry_count_; |
147 // A view to handle focus cycling | 141 // A view to handle focus cycling |
148 TabContentsContainerView* tab_contents_container_; | 142 TabContentsContainerView* tab_contents_container_; |
149 private: | 143 private: |
150 DISALLOW_COPY_AND_ASSIGN(ExternalTabContainer); | 144 DISALLOW_COPY_AND_ASSIGN(ExternalTabContainer); |
151 }; | 145 }; |
152 | 146 |
153 #endif // CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H__ | 147 #endif // CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H__ |
OLD | NEW |