OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/extensions/shell_window.h" | 9 #include "chrome/browser/ui/extensions/shell_window.h" |
10 #include "chrome/browser/ui/views/extensions/extension_view.h" | |
11 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
12 #include "ui/gfx/scoped_sk_region.h" | 11 #include "ui/gfx/scoped_sk_region.h" |
12 #include "ui/views/controls/native/native_view_host.h" | |
13 #include "ui/views/widget/widget_delegate.h" | 13 #include "ui/views/widget/widget_delegate.h" |
14 | 14 |
15 class ExtensionHost; | 15 class Profile; |
16 | 16 |
17 class ShellWindowViews : public ShellWindow, | 17 class ShellWindowViews : public ShellWindow, |
18 public ExtensionView::Container, | 18 public views::NativeViewHost, |
19 public views::WidgetDelegateView { | 19 public views::WidgetDelegate { |
20 public: | 20 public: |
21 explicit ShellWindowViews(ExtensionHost* host); | 21 explicit ShellWindowViews(Profile* profile, |
sky
2012/05/07 15:48:28
remove explicit
| |
22 const Extension* extension, | |
23 const GURL& url); | |
22 | 24 |
23 // BaseWindow implementation. | 25 // BaseWindow implementation. |
24 virtual bool IsActive() const OVERRIDE; | 26 virtual bool IsActive() const OVERRIDE; |
25 virtual bool IsMaximized() const OVERRIDE; | 27 virtual bool IsMaximized() const OVERRIDE; |
26 virtual bool IsMinimized() const OVERRIDE; | 28 virtual bool IsMinimized() const OVERRIDE; |
27 virtual bool IsFullscreen() const OVERRIDE; | 29 virtual bool IsFullscreen() const OVERRIDE; |
28 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 30 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; |
29 virtual gfx::Rect GetBounds() const OVERRIDE; | 31 virtual gfx::Rect GetBounds() const OVERRIDE; |
30 virtual void Show() OVERRIDE; | 32 virtual void Show() OVERRIDE; |
31 virtual void ShowInactive() OVERRIDE; | 33 virtual void ShowInactive() OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... | |
44 virtual views::View* GetContentsView() OVERRIDE; | 46 virtual views::View* GetContentsView() OVERRIDE; |
45 virtual views::NonClientFrameView* CreateNonClientFrameView( | 47 virtual views::NonClientFrameView* CreateNonClientFrameView( |
46 views::Widget* widget) OVERRIDE; | 48 views::Widget* widget) OVERRIDE; |
47 virtual bool CanResize() const OVERRIDE; | 49 virtual bool CanResize() const OVERRIDE; |
48 virtual bool CanMaximize() const OVERRIDE; | 50 virtual bool CanMaximize() const OVERRIDE; |
49 virtual views::Widget* GetWidget() OVERRIDE; | 51 virtual views::Widget* GetWidget() OVERRIDE; |
50 virtual const views::Widget* GetWidget() const OVERRIDE; | 52 virtual const views::Widget* GetWidget() const OVERRIDE; |
51 virtual string16 GetWindowTitle() const OVERRIDE; | 53 virtual string16 GetWindowTitle() const OVERRIDE; |
52 virtual void DeleteDelegate() OVERRIDE; | 54 virtual void DeleteDelegate() OVERRIDE; |
53 | 55 |
54 // ExtensionView::Container implementation. | 56 // Overridden from views::NativeViewHost: |
55 virtual void OnViewWasResized() OVERRIDE; | 57 virtual gfx::NativeCursor GetCursor(const views::MouseEvent& event) OVERRIDE; |
58 virtual void SetVisible(bool is_visible) OVERRIDE; | |
59 virtual void ViewHierarchyChanged( | |
60 bool is_add, views::View *parent, views::View *child) OVERRIDE; | |
61 | |
62 protected: | |
63 // Overridden from views::View. | |
64 virtual void PreferredSizeChanged() OVERRIDE; | |
65 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) OVERRIDE; | |
66 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | |
56 | 67 |
57 private: | 68 private: |
58 virtual ~ShellWindowViews(); | 69 virtual ~ShellWindowViews(); |
59 | 70 |
71 void OnViewWasResized(); | |
72 | |
73 bool initialized_; | |
60 views::Widget* window_; | 74 views::Widget* window_; |
61 | 75 |
62 gfx::ScopedSkRegion caption_region_; | 76 gfx::ScopedSkRegion caption_region_; |
63 | 77 |
64 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews); | 78 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews); |
65 }; | 79 }; |
66 | 80 |
67 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ | 81 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ |
OLD | NEW |