Chromium Code Reviews| 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_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
| 6 #define CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
| 7 | 7 |
| 8 #include "base/gfx/size.h" | 8 #include "base/gfx/size.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents_view.h" | 10 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 11 #include "views/widget/widget_win.h" | 11 #include "views/widget/widget_win.h" |
| 12 | 12 |
| 13 class RenderViewContextMenuWin; | 13 class RenderViewContextMenuWin; |
| 14 class SadTabView; | 14 class SadTabView; |
| 15 struct WebDropData; | 15 struct WebDropData; |
| 16 class WebDropTarget; | 16 class WebDropTarget; |
| 17 | 17 |
| 18 // Windows-specific implementation of the TabContentsView. It is a HWND that | 18 // Windows-specific implementation of the TabContentsView. It is a HWND that |
| 19 // contains all of the contents of the tab and associated child views. | 19 // contains all of the contents of the tab and associated child views. |
| 20 class TabContentsViewWin : public TabContentsView, | 20 class TabContentsViewWin : public TabContentsView, |
| 21 public views::WidgetWin { | 21 public views::WidgetWin { |
| 22 public: | 22 public: |
| 23 // The corresponding TabContents is passed in the constructor, and manages our | 23 // The corresponding TabContents is passed in the constructor, and manages our |
| 24 // lifetime. This doesn't need to be the case, but is this way currently | 24 // lifetime. This doesn't need to be the case, but is this way currently |
| 25 // because that's what was easiest when they were split. | 25 // because that's what was easiest when they were split. |
| 26 explicit TabContentsViewWin(TabContents* tab_contents); | 26 explicit TabContentsViewWin(TabContents* tab_contents); |
| 27 virtual ~TabContentsViewWin(); | 27 virtual ~TabContentsViewWin(); |
| 28 | 28 |
| 29 // Reset the native parent of this view to NULL. Unparented windows should | |
| 30 // not receive any messages. | |
| 31 virtual void Unparent(); | |
|
Ben Goodger (Google)
2009/06/26 21:18:08
doesn't need to be virtual
| |
| 32 | |
| 29 // TabContentsView implementation -------------------------------------------- | 33 // TabContentsView implementation -------------------------------------------- |
| 30 | 34 |
| 31 virtual void CreateView(); | 35 virtual void CreateView(); |
| 32 virtual RenderWidgetHostView* CreateViewForWidget( | 36 virtual RenderWidgetHostView* CreateViewForWidget( |
| 33 RenderWidgetHost* render_widget_host); | 37 RenderWidgetHost* render_widget_host); |
| 34 virtual gfx::NativeView GetNativeView() const; | 38 virtual gfx::NativeView GetNativeView() const; |
| 35 virtual gfx::NativeView GetContentNativeView() const; | 39 virtual gfx::NativeView GetContentNativeView() const; |
| 36 virtual gfx::NativeWindow GetTopLevelNativeWindow() const; | 40 virtual gfx::NativeWindow GetTopLevelNativeWindow() const; |
| 37 virtual void GetContainerBounds(gfx::Rect* out) const; | 41 virtual void GetContainerBounds(gfx::Rect* out) const; |
| 38 virtual void OnContentsDestroy(); | 42 virtual void OnContentsDestroy(); |
| 39 virtual void SetPageTitle(const std::wstring& title); | 43 virtual void SetPageTitle(const std::wstring& title); |
| 40 virtual void OnTabCrashed(); | 44 virtual void OnTabCrashed(); |
| 41 virtual void SizeContents(const gfx::Size& size); | 45 virtual void SizeContents(const gfx::Size& size); |
| 42 virtual void Focus(); | 46 virtual void Focus(); |
| 43 virtual void SetInitialFocus(); | 47 virtual void SetInitialFocus(); |
| 44 virtual void StoreFocus(); | 48 virtual void StoreFocus(); |
| 45 virtual void RestoreFocus(); | 49 virtual void RestoreFocus(); |
| 46 | 50 |
| 47 // Backend implementation of RenderViewHostDelegate::View. | 51 // Backend implementation of RenderViewHostDelegate::View. |
| 48 virtual void ShowContextMenu(const ContextMenuParams& params); | 52 virtual void ShowContextMenu(const ContextMenuParams& params); |
| 49 virtual void StartDragging(const WebDropData& drop_data); | 53 virtual void StartDragging(const WebDropData& drop_data); |
| 50 virtual void UpdateDragCursor(bool is_drop_target); | 54 virtual void UpdateDragCursor(bool is_drop_target); |
| 51 virtual void GotFocus(); | 55 virtual void GotFocus(); |
| 52 virtual void TakeFocus(bool reverse); | 56 virtual void TakeFocus(bool reverse); |
| 53 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 57 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 54 | 58 |
| 59 // WidgetWin overridde. | |
| 60 virtual views::FocusManager* GetFocusManager(); | |
| 61 | |
| 55 private: | 62 private: |
| 56 // Windows events ------------------------------------------------------------ | 63 // Windows events ------------------------------------------------------------ |
| 57 | 64 |
| 58 // Overrides from WidgetWin. | 65 // Overrides from WidgetWin. |
| 59 virtual void OnDestroy(); | 66 virtual void OnDestroy(); |
| 60 virtual void OnHScroll(int scroll_type, short position, HWND scrollbar); | 67 virtual void OnHScroll(int scroll_type, short position, HWND scrollbar); |
| 61 virtual void OnMouseLeave(); | 68 virtual void OnMouseLeave(); |
| 62 virtual LRESULT OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param); | 69 virtual LRESULT OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param); |
| 63 virtual void OnPaint(HDC junk_dc); | 70 virtual void OnPaint(HDC junk_dc); |
| 64 virtual LRESULT OnReflectedMessage(UINT msg, WPARAM w_param, LPARAM l_param); | 71 virtual LRESULT OnReflectedMessage(UINT msg, WPARAM w_param, LPARAM l_param); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 | 104 |
| 98 // Whether to ignore the next CHAR keyboard event. | 105 // Whether to ignore the next CHAR keyboard event. |
| 99 bool ignore_next_char_event_; | 106 bool ignore_next_char_event_; |
| 100 | 107 |
| 101 // The id used in the ViewStorage to store the last focused view. | 108 // The id used in the ViewStorage to store the last focused view. |
| 102 int last_focused_view_storage_id_; | 109 int last_focused_view_storage_id_; |
| 103 | 110 |
| 104 // The context menu. Callbacks are asynchronous so we need to keep it around. | 111 // The context menu. Callbacks are asynchronous so we need to keep it around. |
| 105 scoped_ptr<RenderViewContextMenuWin> context_menu_; | 112 scoped_ptr<RenderViewContextMenuWin> context_menu_; |
| 106 | 113 |
| 114 // The FocusManager associated with this tab. Stored as it is not directly | |
| 115 // accessible when unparented. | |
| 116 views::FocusManager* focus_manager_; | |
| 117 | |
| 107 DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); | 118 DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); |
| 108 }; | 119 }; |
| 109 | 120 |
| 110 #endif // CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ | 121 #endif // CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
| OLD | NEW |