OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "content/browser/tab_contents/tab_contents_view.h" |
| 10 #include "ui/base/win/window_impl.h" |
| 11 |
| 12 class RenderWidgetHostViewWin; |
| 13 |
| 14 // An implementation of TabContentsView for Windows. |
| 15 class TabContentsViewWin : public TabContentsView, |
| 16 public ui::WindowImpl { |
| 17 public: |
| 18 explicit TabContentsViewWin(TabContents* tab_contents); |
| 19 virtual ~TabContentsViewWin(); |
| 20 |
| 21 BEGIN_MSG_MAP_EX(TabContentsViewWin) |
| 22 MESSAGE_HANDLER(WM_CLOSE, OnClose) |
| 23 END_MSG_MAP() |
| 24 |
| 25 // Overridden from TabContentsView: |
| 26 virtual void CreateView(const gfx::Size& initial_size) OVERRIDE; |
| 27 virtual RenderWidgetHostView* CreateViewForWidget( |
| 28 RenderWidgetHost* render_widget_host) OVERRIDE; |
| 29 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| 30 virtual gfx::NativeView GetContentNativeView() const OVERRIDE; |
| 31 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; |
| 32 virtual void GetContainerBounds(gfx::Rect *out) const OVERRIDE; |
| 33 virtual void SetPageTitle(const std::wstring& title) OVERRIDE; |
| 34 virtual void OnTabCrashed(base::TerminationStatus status, |
| 35 int error_code) OVERRIDE; |
| 36 virtual void SizeContents(const gfx::Size& size) OVERRIDE; |
| 37 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; |
| 38 virtual void Focus() OVERRIDE; |
| 39 virtual void SetInitialFocus() OVERRIDE; |
| 40 virtual void StoreFocus() OVERRIDE; |
| 41 virtual void RestoreFocus() OVERRIDE; |
| 42 virtual bool IsDoingDrag() const OVERRIDE; |
| 43 virtual void CancelDragAndCloseTab() OVERRIDE; |
| 44 virtual bool IsEventTracking() const OVERRIDE; |
| 45 virtual void CloseTabAfterEventTracking() OVERRIDE; |
| 46 virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; |
| 47 |
| 48 // Implementation of RenderViewHostDelegate::View. |
| 49 virtual void CreateNewWindow( |
| 50 int route_id, |
| 51 const ViewHostMsg_CreateWindow_Params& params) OVERRIDE; |
| 52 virtual void CreateNewWidget(int route_id, |
| 53 WebKit::WebPopupType popup_type) OVERRIDE; |
| 54 virtual void CreateNewFullscreenWidget(int route_id) OVERRIDE; |
| 55 virtual void ShowCreatedWindow(int route_id, |
| 56 WindowOpenDisposition disposition, |
| 57 const gfx::Rect& initial_pos, |
| 58 bool user_gesture) OVERRIDE; |
| 59 virtual void ShowCreatedWidget(int route_id, |
| 60 const gfx::Rect& initial_pos) OVERRIDE; |
| 61 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; |
| 62 virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; |
| 63 virtual void ShowPopupMenu(const gfx::Rect& bounds, |
| 64 int item_height, |
| 65 double item_font_size, |
| 66 int selected_item, |
| 67 const std::vector<WebMenuItem>& items, |
| 68 bool right_aligned) OVERRIDE; |
| 69 virtual void StartDragging(const WebDropData& drop_data, |
| 70 WebKit::WebDragOperationsMask operations, |
| 71 const SkBitmap& image, |
| 72 const gfx::Point& image_offset) OVERRIDE; |
| 73 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE; |
| 74 virtual void GotFocus() OVERRIDE; |
| 75 virtual void TakeFocus(bool reverse) OVERRIDE; |
| 76 |
| 77 private: |
| 78 // Window message handlers. |
| 79 LRESULT OnClose(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
| 80 |
| 81 // The TabContents whose contents we display. |
| 82 TabContents* tab_contents_; |
| 83 |
| 84 RenderWidgetHostViewWin* view_; |
| 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); |
| 87 }; |
| 88 |
| 89 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
OLD | NEW |