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

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

Issue 10119003: Pull shell window stuff out of ExtensionHost and put in ShellWindow (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Try jobs Created 8 years, 7 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
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 #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" 10 #include "chrome/browser/ui/views/extensions/extension_view.h"
jeremya 2012/05/07 00:54:38 I don't think we need this any more.
benwells 2012/05/07 08:46:15 Done.
11 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
12 #include "ui/gfx/scoped_sk_region.h" 12 #include "ui/gfx/scoped_sk_region.h"
13 #include "ui/views/controls/native/native_view_host.h"
13 #include "ui/views/widget/widget_delegate.h" 14 #include "ui/views/widget/widget_delegate.h"
14 15
15 class ExtensionHost; 16 class Profile;
16 17
17 class ShellWindowViews : public ShellWindow, 18 class ShellWindowViews : public ShellWindow,
18 public ExtensionView::Container, 19 public views::NativeViewHost,
19 public views::WidgetDelegateView { 20 public views::WidgetDelegate {
20 public: 21 public:
21 explicit ShellWindowViews(ExtensionHost* host); 22 explicit ShellWindowViews(Profile* profile,
23 const Extension* extension,
24 const GURL& url);
22 25
23 // BaseWindow implementation. 26 // BaseWindow implementation.
24 virtual bool IsActive() const OVERRIDE; 27 virtual bool IsActive() const OVERRIDE;
25 virtual bool IsMaximized() const OVERRIDE; 28 virtual bool IsMaximized() const OVERRIDE;
26 virtual bool IsMinimized() const OVERRIDE; 29 virtual bool IsMinimized() const OVERRIDE;
27 virtual bool IsFullscreen() const OVERRIDE; 30 virtual bool IsFullscreen() const OVERRIDE;
28 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; 31 virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
29 virtual gfx::Rect GetBounds() const OVERRIDE; 32 virtual gfx::Rect GetBounds() const OVERRIDE;
30 virtual void Show() OVERRIDE; 33 virtual void Show() OVERRIDE;
31 virtual void ShowInactive() OVERRIDE; 34 virtual void ShowInactive() OVERRIDE;
(...skipping 12 matching lines...) Expand all
44 virtual views::View* GetContentsView() OVERRIDE; 47 virtual views::View* GetContentsView() OVERRIDE;
45 virtual views::NonClientFrameView* CreateNonClientFrameView( 48 virtual views::NonClientFrameView* CreateNonClientFrameView(
46 views::Widget* widget) OVERRIDE; 49 views::Widget* widget) OVERRIDE;
47 virtual bool CanResize() const OVERRIDE; 50 virtual bool CanResize() const OVERRIDE;
48 virtual bool CanMaximize() const OVERRIDE; 51 virtual bool CanMaximize() const OVERRIDE;
49 virtual views::Widget* GetWidget() OVERRIDE; 52 virtual views::Widget* GetWidget() OVERRIDE;
50 virtual const views::Widget* GetWidget() const OVERRIDE; 53 virtual const views::Widget* GetWidget() const OVERRIDE;
51 virtual string16 GetWindowTitle() const OVERRIDE; 54 virtual string16 GetWindowTitle() const OVERRIDE;
52 virtual void DeleteDelegate() OVERRIDE; 55 virtual void DeleteDelegate() OVERRIDE;
53 56
54 // ExtensionView::Container implementation. 57 // Overridden from views::NativeViewHost:
55 virtual void OnViewWasResized() OVERRIDE; 58 virtual gfx::NativeCursor GetCursor(const views::MouseEvent& event) OVERRIDE;
59 virtual void SetVisible(bool is_visible) OVERRIDE;
60 virtual void ViewHierarchyChanged(
61 bool is_add, views::View *parent, views::View *child) OVERRIDE;
62
63 protected:
64 // Overridden from views::View.
65 virtual void PreferredSizeChanged() OVERRIDE;
66 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) OVERRIDE;
67 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
56 68
57 private: 69 private:
58 virtual ~ShellWindowViews(); 70 virtual ~ShellWindowViews();
59 71
72 void OnViewWasResized();
73
74 bool initialized_;
60 views::Widget* window_; 75 views::Widget* window_;
61 76
62 gfx::ScopedSkRegion caption_region_; 77 gfx::ScopedSkRegion caption_region_;
63 78
64 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews); 79 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews);
65 }; 80 };
66 81
67 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ 82 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698