| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/gfx/native_widget_types.h" | 12 #include "base/gfx/native_widget_types.h" |
| 13 #include "base/gfx/rect.h" | 13 #include "base/gfx/rect.h" |
| 14 #include "base/gfx/size.h" | 14 #include "base/gfx/size.h" |
| 15 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 15 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 16 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 16 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
| 17 | 17 |
| 18 class Browser; | 18 class Browser; |
| 19 class RenderViewHost; | 19 class RenderViewHost; |
| 20 class RenderWidgetHost; | 20 class RenderWidgetHost; |
| 21 class RenderWidgetHostView; | 21 class RenderWidgetHostView; |
| 22 class TabContents; | 22 class TabContents; |
| 23 class WebKeyboardEvent; | |
| 24 | |
| 25 namespace base { | |
| 26 class WaitableEvent; | |
| 27 } | |
| 28 | 23 |
| 29 // The TabContentsView is an interface that is implemented by the platform- | 24 // The TabContentsView is an interface that is implemented by the platform- |
| 30 // dependent web contents views. The TabContents uses this interface to talk to | 25 // dependent web contents views. The TabContents uses this interface to talk to |
| 31 // them. View-related messages will also get forwarded directly to this class | 26 // them. View-related messages will also get forwarded directly to this class |
| 32 // from RenderViewHost via RenderViewHostDelegate::View. | 27 // from RenderViewHost via RenderViewHostDelegate::View. |
| 33 // | 28 // |
| 34 // It contains a small amount of logic with respect to creating new sub-view | 29 // It contains a small amount of logic with respect to creating new sub-view |
| 35 // that should be the same for all platforms. | 30 // that should be the same for all platforms. |
| 36 class TabContentsView : public RenderViewHostDelegate::View { | 31 class TabContentsView : public RenderViewHostDelegate::View { |
| 37 public: | 32 public: |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // do some book-keeping associated with the request. The request is then | 169 // do some book-keeping associated with the request. The request is then |
| 175 // forwarded to *Internal which does platform-specific work. | 170 // forwarded to *Internal which does platform-specific work. |
| 176 virtual void CreateNewWindow(int route_id); | 171 virtual void CreateNewWindow(int route_id); |
| 177 virtual void CreateNewWidget(int route_id, bool activatable); | 172 virtual void CreateNewWidget(int route_id, bool activatable); |
| 178 virtual void ShowCreatedWindow(int route_id, | 173 virtual void ShowCreatedWindow(int route_id, |
| 179 WindowOpenDisposition disposition, | 174 WindowOpenDisposition disposition, |
| 180 const gfx::Rect& initial_pos, | 175 const gfx::Rect& initial_pos, |
| 181 bool user_gesture, | 176 bool user_gesture, |
| 182 const GURL& creator_url); | 177 const GURL& creator_url); |
| 183 virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); | 178 virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); |
| 179 virtual bool IsReservedAccelerator(const NativeWebKeyboardEvent& event); |
| 184 | 180 |
| 185 // The TabContents whose contents we display. | 181 // The TabContents whose contents we display. |
| 186 TabContents* tab_contents_; | 182 TabContents* tab_contents_; |
| 187 | 183 |
| 188 // Tracks created TabContents objects that have not been shown yet. They are | 184 // Tracks created TabContents objects that have not been shown yet. They are |
| 189 // identified by the route ID passed to CreateNewWindow. | 185 // identified by the route ID passed to CreateNewWindow. |
| 190 typedef std::map<int, TabContents*> PendingContents; | 186 typedef std::map<int, TabContents*> PendingContents; |
| 191 PendingContents pending_contents_; | 187 PendingContents pending_contents_; |
| 192 | 188 |
| 193 // These maps hold on to the widgets that we created on behalf of the | 189 // These maps hold on to the widgets that we created on behalf of the |
| 194 // renderer that haven't shown yet. | 190 // renderer that haven't shown yet. |
| 195 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; | 191 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; |
| 196 PendingWidgetViews pending_widget_views_; | 192 PendingWidgetViews pending_widget_views_; |
| 197 | 193 |
| 198 // The page content's intrinsic width. | 194 // The page content's intrinsic width. |
| 199 int preferred_width_; | 195 int preferred_width_; |
| 200 | 196 |
| 201 DISALLOW_COPY_AND_ASSIGN(TabContentsView); | 197 DISALLOW_COPY_AND_ASSIGN(TabContentsView); |
| 202 }; | 198 }; |
| 203 | 199 |
| 204 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ | 200 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_H_ |
| OLD | NEW |