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

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

Issue 8068020: Converts usage of GetBrowserViewForNativeWindow to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback, and make ShowPageInfo platform specific Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_EXTENSION_POPUP_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/extensions/extension_host.h" 10 #include "chrome/browser/extensions/extension_host.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // valid parameter for pop-ups not associated with a browser. 46 // valid parameter for pop-ups not associated with a browser.
47 // The positioning of the pop-up is determined by |arrow_location| according 47 // The positioning of the pop-up is determined by |arrow_location| according
48 // to the following logic: The popup is anchored so that the corner indicated 48 // to the following logic: The popup is anchored so that the corner indicated
49 // by value of |arrow_location| remains fixed during popup resizes. 49 // by value of |arrow_location| remains fixed during popup resizes.
50 // If |arrow_location| is BOTTOM_*, then the popup 'pops up', otherwise 50 // If |arrow_location| is BOTTOM_*, then the popup 'pops up', otherwise
51 // the popup 'drops down'. 51 // the popup 'drops down'.
52 // Pass |inspect_with_devtools| as true to pin the popup open and show the 52 // Pass |inspect_with_devtools| as true to pin the popup open and show the
53 // devtools window for it. 53 // devtools window for it.
54 // The actual display of the popup is delayed until the page contents 54 // The actual display of the popup is delayed until the page contents
55 // finish loading in order to minimize UI flashing and resizing. 55 // finish loading in order to minimize UI flashing and resizing.
56 static ExtensionPopup* Show(const GURL& url, Browser* browser, 56 static ExtensionPopup* Show(const GURL& url,
57 Browser* browser,
57 const gfx::Rect& relative_to, 58 const gfx::Rect& relative_to,
58 views::BubbleBorder::ArrowLocation arrow_location, 59 views::BubbleBorder::ArrowLocation arrow_location,
59 bool inspect_with_devtools, 60 bool inspect_with_devtools,
60 Observer* observer); 61 Observer* observer);
61 62
62 // Closes the ExtensionPopup. 63 // Closes the ExtensionPopup.
63 void Close(); 64 void Close();
64 65
65 // Some clients wish to do their own custom focus change management. If this 66 // Some clients wish to do their own custom focus change management. If this
66 // is set to false, then the ExtensionPopup will not do anything in response 67 // is set to false, then the ExtensionPopup will not do anything in response
(...skipping 24 matching lines...) Expand all
91 virtual void OnExtensionMouseLeave(ExtensionView* view) { } 92 virtual void OnExtensionMouseLeave(ExtensionView* view) { }
92 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view); 93 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view);
93 94
94 // The min/max height of popups. 95 // The min/max height of popups.
95 static const int kMinWidth; 96 static const int kMinWidth;
96 static const int kMinHeight; 97 static const int kMinHeight;
97 static const int kMaxWidth; 98 static const int kMaxWidth;
98 static const int kMaxHeight; 99 static const int kMaxHeight;
99 100
100 private: 101 private:
101 ExtensionPopup(ExtensionHost* host, 102 ExtensionPopup(Browser* browser,
102 views::Widget* frame, 103 ExtensionHost* host,
103 const gfx::Rect& relative_to, 104 const gfx::Rect& relative_to,
104 views::BubbleBorder::ArrowLocation arrow_location, 105 views::BubbleBorder::ArrowLocation arrow_location,
105 bool inspect_with_devtools, 106 bool inspect_with_devtools,
106 Observer* observer); 107 Observer* observer);
107 108
108 // The area on the screen that the popup should be positioned relative to. 109 // The area on the screen that the popup should be positioned relative to.
109 gfx::Rect relative_to_; 110 gfx::Rect relative_to_;
110 111
111 // The contained host for the view. 112 // The contained host for the view.
112 scoped_ptr<ExtensionHost> extension_host_; 113 scoped_ptr<ExtensionHost> extension_host_;
(...skipping 10 matching lines...) Expand all
123 124
124 NotificationRegistrar registrar_; 125 NotificationRegistrar registrar_;
125 126
126 // The observer of this popup. 127 // The observer of this popup.
127 Observer* observer_; 128 Observer* observer_;
128 129
129 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); 130 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup);
130 }; 131 };
131 132
132 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ 133 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698