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

Side by Side Diff: chrome/browser/views/extensions/extension_popup.h

Issue 295051: Constrain extension popups to a min/max size (Closed)
Patch Set: Created 11 years, 2 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_EXTENSIONS_EXTENSION_POPUP_H_ 5 #ifndef CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
6 #define CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ 6 #define CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
7 7
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/views/browser_bubble.h" 9 #include "chrome/browser/views/browser_bubble.h"
10 #include "chrome/browser/views/bubble_border.h" 10 #include "chrome/browser/views/bubble_border.h"
(...skipping 29 matching lines...) Expand all
40 // NotificationObserver overrides. 40 // NotificationObserver overrides.
41 virtual void Observe(NotificationType type, 41 virtual void Observe(NotificationType type,
42 const NotificationSource& source, 42 const NotificationSource& source,
43 const NotificationDetails& details); 43 const NotificationDetails& details);
44 44
45 // ExtensionView::Container overrides. 45 // ExtensionView::Container overrides.
46 virtual void OnExtensionMouseEvent(ExtensionView* view) { }; 46 virtual void OnExtensionMouseEvent(ExtensionView* view) { };
47 virtual void OnExtensionMouseLeave(ExtensionView* view) { }; 47 virtual void OnExtensionMouseLeave(ExtensionView* view) { };
48 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view); 48 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view);
49 49
50 // The min/max height of popups.
51 static const int kMinWidth;
52 static const int kMinHeight;
53 static const int kMaxWidth;
54 static const int kMaxHeight;
55
50 private: 56 private:
51 ExtensionPopup(ExtensionHost* host, 57 ExtensionPopup(ExtensionHost* host,
52 views::Widget* frame, 58 views::Widget* frame,
53 const gfx::Rect& relative_to); 59 const gfx::Rect& relative_to);
54 60
55 // The area on the screen that the popup should be positioned relative to. 61 // The area on the screen that the popup should be positioned relative to.
56 gfx::Rect relative_to_; 62 gfx::Rect relative_to_;
57 63
58 // The contained host for the view. 64 // The contained host for the view.
59 scoped_ptr<ExtensionHost> extension_host_; 65 scoped_ptr<ExtensionHost> extension_host_;
60 66
61 NotificationRegistrar registrar_; 67 NotificationRegistrar registrar_;
62 68
63 // A separate widget and associated pieces to draw a border behind the 69 // A separate widget and associated pieces to draw a border behind the
64 // popup. This has to be a separate window in order to support transparency. 70 // popup. This has to be a separate window in order to support transparency.
65 // Layered windows can't contain native child windows, so we wouldn't be 71 // Layered windows can't contain native child windows, so we wouldn't be
66 // able to have the ExtensionView child. 72 // able to have the ExtensionView child.
67 views::Widget* border_widget_; 73 views::Widget* border_widget_;
68 BubbleBorder* border_; 74 BubbleBorder* border_;
69 views::View* border_view_; 75 views::View* border_view_;
70 76
71 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); 77 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup);
72 }; 78 };
73 79
74 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_H_ 80 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698