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

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h

Issue 11419277: Fix showing constrained window for uninitialized tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h
index 24ef877772166c2c7666d205a69f63c2a4848c79..8704135e14ebc09551632f3f3e464a9db2c57bd2 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h
@@ -9,6 +9,8 @@
#include "base/memory/scoped_nsobject.h"
#include "chrome/browser/ui/constrained_window.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
namespace content {
class WebContents;
@@ -25,7 +27,8 @@ class ConstrainedWindowMacDelegate2 {
// Constrained window implementation for Mac.
// Normally an instance of this class is owned by the delegate. The delegate
// should delete the instance when the window is closed.
-class ConstrainedWindowMac2 : public ConstrainedWindow {
+class ConstrainedWindowMac2 : public ConstrainedWindow,
+ public content::NotificationObserver {
public:
ConstrainedWindowMac2(ConstrainedWindowMacDelegate2* delegate,
content::WebContents* web_contents,
@@ -40,6 +43,11 @@ class ConstrainedWindowMac2 : public ConstrainedWindow {
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
virtual bool CanShowConstrainedWindow() OVERRIDE;
+ // content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
private:
// Gets the parent window of the dialog.
NSWindow* GetParentWindow() const;
@@ -50,6 +58,12 @@ class ConstrainedWindowMac2 : public ConstrainedWindow {
content::WebContents* web_contents_;
scoped_nsobject<NSWindow> window_;
+
+ // A scoped container for notification registries.
+ content::NotificationRegistrar registrar_;
+
+ // This is true if the constrained window is waiting to be shown.
+ bool pending_show_;
};
#endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_2_
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698