| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_WIN_H_ | |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_WIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "content/public/browser/web_contents_view_delegate.h" | |
| 13 | |
| 14 class ConstrainedWindowViews; | |
| 15 class RenderViewContextMenuViews; | |
| 16 class WebDragBookmarkHandlerWin; | |
| 17 | |
| 18 namespace content { | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 namespace views { | |
| 23 class FocusManager; | |
| 24 class Widget; | |
| 25 } | |
| 26 | |
| 27 // A chrome specific class that extends TabContentsViewWin with features like | |
| 28 // constrained windows, which live in chrome. | |
| 29 class ChromeWebContentsViewDelegateWin | |
| 30 : public content::WebContentsViewDelegate { | |
| 31 public: | |
| 32 explicit ChromeWebContentsViewDelegateWin(content::WebContents* web_contents); | |
| 33 virtual ~ChromeWebContentsViewDelegateWin(); | |
| 34 | |
| 35 // Overridden from WebContentsViewDelegate: | |
| 36 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; | |
| 37 virtual void StoreFocus() OVERRIDE; | |
| 38 virtual void RestoreFocus() OVERRIDE; | |
| 39 virtual bool Focus() OVERRIDE; | |
| 40 virtual void TakeFocus(bool reverse) OVERRIDE; | |
| 41 virtual void ShowContextMenu( | |
| 42 const content::ContextMenuParams& params) OVERRIDE; | |
| 43 virtual void SizeChanged(const gfx::Size& size) OVERRIDE; | |
| 44 | |
| 45 private: | |
| 46 views::Widget* GetTopLevelWidget(); | |
| 47 views::FocusManager* GetFocusManager(); | |
| 48 void SetInitialFocus(); | |
| 49 | |
| 50 // The id used in the ViewStorage to store the last focused view. | |
| 51 int last_focused_view_storage_id_; | |
| 52 | |
| 53 // The context menu is reset every time we show it, but we keep a pointer to | |
| 54 // between uses so that it won't go out of scope before we're done with it. | |
| 55 scoped_ptr<RenderViewContextMenuViews> context_menu_; | |
| 56 | |
| 57 // The chrome specific delegate that receives events from WebDragDest. | |
| 58 scoped_ptr<WebDragBookmarkHandlerWin> bookmark_handler_; | |
| 59 | |
| 60 content::WebContents* web_contents_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateWin); | |
| 63 }; | |
| 64 | |
| 65 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_WIN_H_ | |
| OLD | NEW |