| 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_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // first time. | 108 // first time. |
| 109 virtual void SetInitialFocus() = 0; | 109 virtual void SetInitialFocus() = 0; |
| 110 | 110 |
| 111 // Stores the currently focused view. | 111 // Stores the currently focused view. |
| 112 virtual void StoreFocus() = 0; | 112 virtual void StoreFocus() = 0; |
| 113 | 113 |
| 114 // Restores focus to the last focus view. If StoreFocus has not yet been | 114 // Restores focus to the last focus view. If StoreFocus has not yet been |
| 115 // invoked, SetInitialFocus is invoked. | 115 // invoked, SetInitialFocus is invoked. |
| 116 virtual void RestoreFocus() = 0; | 116 virtual void RestoreFocus() = 0; |
| 117 | 117 |
| 118 // Keyboard events forwarding from the RenderViewHost. |
| 119 // The default implementation just forward the events to the |
| 120 // TabContentsDelegate object. |
| 121 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 122 bool* is_keyboard_shortcut); |
| 123 |
| 124 // Keyboard events forwarding from the RenderViewHost. |
| 125 // The default implementation just forward the events to the |
| 126 // TabContentsDelegate object. |
| 127 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 128 |
| 118 // Simple mouse event forwarding from the RenderViewHost. | 129 // Simple mouse event forwarding from the RenderViewHost. |
| 119 virtual void HandleMouseEvent() {} | 130 virtual void HandleMouseEvent() {} |
| 120 virtual void HandleMouseLeave() {} | 131 virtual void HandleMouseLeave() {} |
| 121 | 132 |
| 122 // Set and return the content's intrinsic width. | 133 // Set and return the content's intrinsic width. |
| 123 virtual void UpdatePreferredSize(const gfx::Size& pref_size); | 134 virtual void UpdatePreferredSize(const gfx::Size& pref_size); |
| 124 int preferred_width() const { | 135 int preferred_width() const { |
| 125 return preferred_width_; | 136 return preferred_width_; |
| 126 } | 137 } |
| 127 | 138 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // do some book-keeping associated with the request. The request is then | 179 // do some book-keeping associated with the request. The request is then |
| 169 // forwarded to *Internal which does platform-specific work. | 180 // forwarded to *Internal which does platform-specific work. |
| 170 virtual void CreateNewWindow(int route_id); | 181 virtual void CreateNewWindow(int route_id); |
| 171 virtual void CreateNewWidget(int route_id, bool activatable); | 182 virtual void CreateNewWidget(int route_id, bool activatable); |
| 172 virtual void ShowCreatedWindow(int route_id, | 183 virtual void ShowCreatedWindow(int route_id, |
| 173 WindowOpenDisposition disposition, | 184 WindowOpenDisposition disposition, |
| 174 const gfx::Rect& initial_pos, | 185 const gfx::Rect& initial_pos, |
| 175 bool user_gesture, | 186 bool user_gesture, |
| 176 const GURL& creator_url); | 187 const GURL& creator_url); |
| 177 virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); | 188 virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); |
| 178 virtual bool IsReservedAccelerator(const NativeWebKeyboardEvent& event); | |
| 179 | 189 |
| 180 // The TabContents whose contents we display. | 190 // The TabContents whose contents we display. |
| 181 TabContents* tab_contents_; | 191 TabContents* tab_contents_; |
| 182 | 192 |
| 183 // Tracks created TabContents objects that have not been shown yet. They are | 193 // Tracks created TabContents objects that have not been shown yet. They are |
| 184 // identified by the route ID passed to CreateNewWindow. | 194 // identified by the route ID passed to CreateNewWindow. |
| 185 typedef std::map<int, TabContents*> PendingContents; | 195 typedef std::map<int, TabContents*> PendingContents; |
| 186 PendingContents pending_contents_; | 196 PendingContents pending_contents_; |
| 187 | 197 |
| 188 // These maps hold on to the widgets that we created on behalf of the | 198 // These maps hold on to the widgets that we created on behalf of the |
| 189 // renderer that haven't shown yet. | 199 // renderer that haven't shown yet. |
| 190 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; | 200 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; |
| 191 PendingWidgetViews pending_widget_views_; | 201 PendingWidgetViews pending_widget_views_; |
| 192 | 202 |
| 193 // The page content's intrinsic width. | 203 // The page content's intrinsic width. |
| 194 int preferred_width_; | 204 int preferred_width_; |
| 195 | 205 |
| 196 DISALLOW_COPY_AND_ASSIGN(TabContentsView); | 206 DISALLOW_COPY_AND_ASSIGN(TabContentsView); |
| 197 }; | 207 }; |
| 198 | 208 |
| 199 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 209 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
| OLD | NEW |