Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/browser/ui/views/extensions/shell_window_views.h

Issue 10825240: Refactor ShellWindow to separate platform-specific code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 7
8 #include "chrome/browser/ui/base_window.h"
9 #include "chrome/browser/ui/extensions/native_shell_window.h"
8 #include "chrome/browser/ui/extensions/shell_window.h" 10 #include "chrome/browser/ui/extensions/shell_window.h"
9 #include "third_party/skia/include/core/SkRegion.h" 11 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/gfx/rect.h" 12 #include "ui/gfx/rect.h"
11 #include "ui/views/widget/widget_delegate.h" 13 #include "ui/views/widget/widget_delegate.h"
12 14
13 class Profile; 15 class Profile;
14 16
17 namespace content {
18 class WebContents;
19 }
20
15 namespace extensions { 21 namespace extensions {
16 class Extension; 22 class Extension;
17 struct DraggableRegion; 23 struct DraggableRegion;
18 } 24 }
19 25
20 namespace views { 26 namespace views {
21 class WebView; 27 class WebView;
22 } 28 }
23 29
24 class ShellWindowViews : public ShellWindow, 30 class ShellWindowViews : public NativeShellWindow,
25 public views::WidgetDelegateView { 31 public views::WidgetDelegateView {
26 public: 32 public:
27 ShellWindowViews(Profile* profile, 33 ShellWindowViews(ShellWindow* shell_window,
28 const extensions::Extension* extension, 34 const ShellWindow::CreateParams& params);
29 const GURL& url,
30 const CreateParams& params);
31 35
32 bool frameless() const { return frameless_; } 36 bool frameless() const { return frameless_; }
33 SkRegion* draggable_region() { return draggable_region_.get(); } 37 SkRegion* draggable_region() { return draggable_region_.get(); }
34 38
35 // BaseWindow implementation. 39 // BaseWindow implementation.
36 virtual bool IsActive() const OVERRIDE; 40 virtual bool IsActive() const OVERRIDE;
37 virtual bool IsMaximized() const OVERRIDE; 41 virtual bool IsMaximized() const OVERRIDE;
38 virtual bool IsMinimized() const OVERRIDE; 42 virtual bool IsMinimized() const OVERRIDE;
39 virtual bool IsFullscreen() const OVERRIDE; 43 virtual bool IsFullscreen() const OVERRIDE;
40 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; 44 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
(...skipping 25 matching lines...) Expand all
66 70
67 protected: 71 protected:
68 // views::View implementation. 72 // views::View implementation.
69 virtual void Layout() OVERRIDE; 73 virtual void Layout() OVERRIDE;
70 virtual void ViewHierarchyChanged( 74 virtual void ViewHierarchyChanged(
71 bool is_add, views::View *parent, views::View *child) OVERRIDE; 75 bool is_add, views::View *parent, views::View *child) OVERRIDE;
72 virtual gfx::Size GetMinimumSize() OVERRIDE; 76 virtual gfx::Size GetMinimumSize() OVERRIDE;
73 virtual gfx::Size GetMaximumSize() OVERRIDE; 77 virtual gfx::Size GetMaximumSize() OVERRIDE;
74 virtual void OnFocus() OVERRIDE; 78 virtual void OnFocus() OVERRIDE;
75 79
80 // NativeShellWindow implementation.
81 virtual void UpdateWindowTitle() OVERRIDE;
82 virtual void SetFullscreen(bool fullscreen) OVERRIDE;
83 virtual bool IsFullscreenOrPending() const OVERRIDE;
84
85 Profile* profile() { return shell_window_->profile(); }
86 content::WebContents* web_contents() {
87 return shell_window_->web_contents();
88 }
89 const extensions::Extension* extension() {
90 return shell_window_->extension();
91 }
92
76 private: 93 private:
77 friend class ShellWindowFrameView; 94 friend class ShellWindowFrameView;
78 95
79 virtual ~ShellWindowViews(); 96 virtual ~ShellWindowViews();
80 97
81 // ShellWindow implementation. 98 // ShellWindow implementation.
82 virtual void UpdateWindowTitle() OVERRIDE; 99 virtual void UpdateWindowTitle() OVERRIDE;
83 virtual void SetFullscreen(bool fullscreen) OVERRIDE; 100 virtual void SetFullscreen(bool fullscreen) OVERRIDE;
84 virtual bool IsFullscreenOrPending() const OVERRIDE; 101 virtual bool IsFullscreenOrPending() const OVERRIDE;
85 virtual void UpdateDraggableRegions( 102 virtual void UpdateDraggableRegions(
86 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; 103 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE;
87 104
88 void OnViewWasResized(); 105 void OnViewWasResized();
89 106
90 views::WebView* web_view_; 107 views::WebView* web_view_;
91 views::Widget* window_; 108 views::Widget* window_;
92 bool is_fullscreen_; 109 bool is_fullscreen_;
93 110
94 scoped_ptr<SkRegion> draggable_region_; 111 scoped_ptr<SkRegion> draggable_region_;
95 112
96 bool frameless_; 113 bool frameless_;
97 gfx::Size minimum_size_; 114 gfx::Size minimum_size_;
98 gfx::Size maximum_size_; 115 gfx::Size maximum_size_;
99 116
117 ShellWindow* shell_window_;
118
100 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews); 119 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews);
101 }; 120 };
102 121
103 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ 122 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698