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

Side by Side Diff: chrome/browser/cocoa/constrained_window_mac.h

Issue 392018: Enforce that only one constrained window is displayed at once per tab. (Closed)
Patch Set: Set focus correctly on linux Created 11 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/cocoa/constrained_window_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_COCOA_CONSTRAINED_WINDOW_MAC_H_ 5 #ifndef CHROME_BROWSER_COCOA_CONSTRAINED_WINDOW_MAC_H_
6 #define CHROME_BROWSER_COCOA_CONSTRAINED_WINDOW_MAC_H_ 6 #define CHROME_BROWSER_COCOA_CONSTRAINED_WINDOW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "chrome/browser/tab_contents/constrained_window.h" 10 #include "chrome/browser/tab_contents/constrained_window.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Constrained windows work slightly differently on OS X than on the other 110 // Constrained windows work slightly differently on OS X than on the other
111 // platforms: 111 // platforms:
112 // 1. A constrained window is bound to both a tab and window on OS X. 112 // 1. A constrained window is bound to both a tab and window on OS X.
113 // 2. The delegate is responsible for closing the sheet again when it is 113 // 2. The delegate is responsible for closing the sheet again when it is
114 // deleted. 114 // deleted.
115 class ConstrainedWindowMac : public ConstrainedWindow { 115 class ConstrainedWindowMac : public ConstrainedWindow {
116 public: 116 public:
117 virtual ~ConstrainedWindowMac(); 117 virtual ~ConstrainedWindowMac();
118 118
119 // Overridden from ConstrainedWindow: 119 // Overridden from ConstrainedWindow:
120 virtual void ShowConstrainedWindow();
120 virtual void CloseConstrainedWindow(); 121 virtual void CloseConstrainedWindow();
121 122
122 // Returns the TabContents that constrains this Constrained Window. 123 // Returns the TabContents that constrains this Constrained Window.
123 TabContents* owner() const { return owner_; } 124 TabContents* owner() const { return owner_; }
124 125
125 // Returns the window's delegate. 126 // Returns the window's delegate.
126 ConstrainedWindowMacDelegate* delegate() { return delegate_; } 127 ConstrainedWindowMacDelegate* delegate() { return delegate_; }
127 128
128 // Makes the constrained window visible, if it is not yet visible. 129 // Makes the constrained window visible, if it is not yet visible.
129 void Realize(BrowserWindowController* controller); 130 void Realize(BrowserWindowController* controller);
130 131
131 private: 132 private:
132 friend class ConstrainedWindow; 133 friend class ConstrainedWindow;
133 134
134 ConstrainedWindowMac(TabContents* owner, 135 ConstrainedWindowMac(TabContents* owner,
135 ConstrainedWindowMacDelegate* delegate); 136 ConstrainedWindowMacDelegate* delegate);
136 137
137 // The TabContents that owns and constrains this ConstrainedWindow. 138 // The TabContents that owns and constrains this ConstrainedWindow.
138 TabContents* owner_; 139 TabContents* owner_;
139 140
140 // Delegate that provides the contents of this constrained window. 141 // Delegate that provides the contents of this constrained window.
141 ConstrainedWindowMacDelegate* delegate_; 142 ConstrainedWindowMacDelegate* delegate_;
142 143
143 // Controller of the window that contains this sheet. 144 // Controller of the window that contains this sheet.
144 BrowserWindowController* controller_; 145 BrowserWindowController* controller_;
145 146
147 // Stores if |ShowConstrainedWindow()| was called.
148 bool should_be_visible_;
149
146 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowMac); 150 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowMac);
147 }; 151 };
148 152
149 #endif // CHROME_BROWSER_COCOA_CONSTRAINED_WINDOW_MAC_H_ 153 #endif // CHROME_BROWSER_COCOA_CONSTRAINED_WINDOW_MAC_H_
150 154
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/constrained_window_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698