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

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

Issue 10534093: TabContentsWrapper -> TabContents, part 37. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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) 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_COCOA_CONSTRAINED_WINDOW_MAC_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_MAC_H_ 6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #import <Cocoa/Cocoa.h> 9 #import <Cocoa/Cocoa.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_nsobject.h" 13 #include "base/memory/scoped_nsobject.h"
14 #include "chrome/browser/ui/constrained_window.h" 14 #include "chrome/browser/ui/constrained_window.h"
15 15
16 @class BrowserWindowController; 16 @class BrowserWindowController;
17 @class GTMWindowSheetController; 17 @class GTMWindowSheetController;
18 @class NSView; 18 @class NSView;
19 @class NSWindow; 19 @class NSWindow;
20 class TabContents; 20 class TabContents;
21 typedef TabContents TabContentsWrapper;
22 21
23 // Base class for constrained dialog delegates. Never inherit from this 22 // Base class for constrained dialog delegates. Never inherit from this
24 // directly. 23 // directly.
25 class ConstrainedWindowMacDelegate { 24 class ConstrainedWindowMacDelegate {
26 public: 25 public:
27 ConstrainedWindowMacDelegate() : is_sheet_open_(false) {} 26 ConstrainedWindowMacDelegate() : is_sheet_open_(false) {}
28 virtual ~ConstrainedWindowMacDelegate() {} 27 virtual ~ConstrainedWindowMacDelegate() {}
29 28
30 // Tells the delegate to either delete itself or set up a task to delete 29 // Tells the delegate to either delete itself or set up a task to delete
31 // itself later. Note that you MUST close the sheet belonging to your delegate 30 // itself later. Note that you MUST close the sheet belonging to your delegate
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Constrained window implementation for the Mac port. A constrained window 103 // Constrained window implementation for the Mac port. A constrained window
105 // is a per-tab sheet on OS X. 104 // is a per-tab sheet on OS X.
106 // 105 //
107 // Constrained windows work slightly differently on OS X than on the other 106 // Constrained windows work slightly differently on OS X than on the other
108 // platforms: 107 // platforms:
109 // 1. A constrained window is bound to both a tab and window on OS X. 108 // 1. A constrained window is bound to both a tab and window on OS X.
110 // 2. The delegate is responsible for closing the sheet again when it is 109 // 2. The delegate is responsible for closing the sheet again when it is
111 // deleted. 110 // deleted.
112 class ConstrainedWindowMac : public ConstrainedWindow { 111 class ConstrainedWindowMac : public ConstrainedWindow {
113 public: 112 public:
114 ConstrainedWindowMac(TabContentsWrapper* wrapper, 113 ConstrainedWindowMac(TabContents* tab_contents,
115 ConstrainedWindowMacDelegate* delegate); 114 ConstrainedWindowMacDelegate* delegate);
116 virtual ~ConstrainedWindowMac(); 115 virtual ~ConstrainedWindowMac();
117 116
118 // Overridden from ConstrainedWindow: 117 // Overridden from ConstrainedWindow:
119 virtual void ShowConstrainedWindow() OVERRIDE; 118 virtual void ShowConstrainedWindow() OVERRIDE;
120 virtual void CloseConstrainedWindow() OVERRIDE; 119 virtual void CloseConstrainedWindow() OVERRIDE;
121 120
122 // Returns the TabContentsWrapper that constrains this Constrained Window. 121 // Returns the TabContents that constrains this Constrained Window.
123 TabContentsWrapper* owner() const { return wrapper_; } 122 TabContents* owner() const { return tab_contents_; }
124 123
125 // Returns the window's delegate. 124 // Returns the window's delegate.
126 ConstrainedWindowMacDelegate* delegate() { return delegate_; } 125 ConstrainedWindowMacDelegate* delegate() { return delegate_; }
127 126
128 // Makes the constrained window visible, if it is not yet visible. 127 // Makes the constrained window visible, if it is not yet visible.
129 void Realize(BrowserWindowController* controller); 128 void Realize(BrowserWindowController* controller);
130 129
131 private: 130 private:
132 friend class ConstrainedWindow; 131 friend class ConstrainedWindow;
133 132
134 // The TabContentsWrapper that owns and constrains this ConstrainedWindow. 133 // The TabContents that owns and constrains this ConstrainedWindow.
135 TabContentsWrapper* wrapper_; 134 TabContents* tab_contents_;
136 135
137 // Delegate that provides the contents of this constrained window. 136 // Delegate that provides the contents of this constrained window.
138 ConstrainedWindowMacDelegate* delegate_; 137 ConstrainedWindowMacDelegate* delegate_;
139 138
140 // Controller of the window that contains this sheet. 139 // Controller of the window that contains this sheet.
141 BrowserWindowController* controller_; 140 BrowserWindowController* controller_;
142 141
143 // Stores if |ShowConstrainedWindow()| was called. 142 // Stores if |ShowConstrainedWindow()| was called.
144 bool should_be_visible_; 143 bool should_be_visible_;
145 144
146 // True when CloseConstrainedWindow has been called. 145 // True when CloseConstrainedWindow has been called.
147 bool closing_; 146 bool closing_;
148 147
149 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowMac); 148 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowMac);
150 }; 149 };
151 150
152 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_MAC_H_ 151 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_MAC_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm ('k') | chrome/browser/ui/cocoa/constrained_window_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698