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

Side by Side Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h

Issue 186343002: Create windows for new app window bounds API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self nit: comment Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_APPS_NATIVE_APP_WINDOW_COCOA_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ 6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 virtual bool HasFrameColor() const OVERRIDE; 129 virtual bool HasFrameColor() const OVERRIDE;
130 virtual SkColor FrameColor() const OVERRIDE; 130 virtual SkColor FrameColor() const OVERRIDE;
131 virtual gfx::Insets GetFrameInsets() const OVERRIDE; 131 virtual gfx::Insets GetFrameInsets() const OVERRIDE;
132 132
133 // These are used to simulate Mac-style hide/show. Since windows can be hidden 133 // These are used to simulate Mac-style hide/show. Since windows can be hidden
134 // and shown using the app.window API, this sets is_hidden_with_app_ to 134 // and shown using the app.window API, this sets is_hidden_with_app_ to
135 // differentiate the reason a window was hidden. 135 // differentiate the reason a window was hidden.
136 virtual void ShowWithApp() OVERRIDE; 136 virtual void ShowWithApp() OVERRIDE;
137 virtual void HideWithApp() OVERRIDE; 137 virtual void HideWithApp() OVERRIDE;
138 virtual void UpdateShelfMenu() OVERRIDE; 138 virtual void UpdateShelfMenu() OVERRIDE;
139 virtual gfx::Size GetMinimumSize() const OVERRIDE; 139 virtual gfx::Size GetContentMinimumSize() const OVERRIDE;
140 virtual void SetMinimumSize(const gfx::Size& size) OVERRIDE; 140 virtual void SetContentMinimumSize(const gfx::Size& size) OVERRIDE;
141 virtual gfx::Size GetMaximumSize() const OVERRIDE; 141 virtual gfx::Size GetContentMaximumSize() const OVERRIDE;
142 virtual void SetMaximumSize(const gfx::Size& size) OVERRIDE; 142 virtual void SetContentMaximumSize(const gfx::Size& size) OVERRIDE;
143 143
144 // WebContentsObserver implementation. 144 // WebContentsObserver implementation.
145 virtual void RenderViewCreated(content::RenderViewHost* rvh) OVERRIDE; 145 virtual void RenderViewCreated(content::RenderViewHost* rvh) OVERRIDE;
146 146
147 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; 147 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
148 148
149 // WebContentsModalDialogHost implementation. 149 // WebContentsModalDialogHost implementation.
150 virtual gfx::NativeView GetHostView() const OVERRIDE; 150 virtual gfx::NativeView GetHostView() const OVERRIDE;
151 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; 151 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE;
152 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; 152 virtual gfx::Size GetMaximumDialogSize() OVERRIDE;
(...skipping 25 matching lines...) Expand all
178 void InstallDraggableRegionViews(); 178 void InstallDraggableRegionViews();
179 void UpdateDraggableRegionsForSystemDrag( 179 void UpdateDraggableRegionsForSystemDrag(
180 const std::vector<extensions::DraggableRegion>& regions, 180 const std::vector<extensions::DraggableRegion>& regions,
181 const extensions::DraggableRegion* draggable_area); 181 const extensions::DraggableRegion* draggable_area);
182 void UpdateDraggableRegionsForCustomDrag( 182 void UpdateDraggableRegionsForCustomDrag(
183 const std::vector<extensions::DraggableRegion>& regions); 183 const std::vector<extensions::DraggableRegion>& regions);
184 184
185 // Cache |restored_bounds_| only if the window is currently restored. 185 // Cache |restored_bounds_| only if the window is currently restored.
186 void UpdateRestoredBounds(); 186 void UpdateRestoredBounds();
187 187
188 // Update the minimum and maximum size constraints, fullscreen and resize
189 // controls.
190 void SetContentSizeConstraints(const gfx::Size& minimum_size,
191 const gfx::Size& maximum_size);
192
188 // Hides the window unconditionally. Used by Hide and HideWithApp. 193 // Hides the window unconditionally. Used by Hide and HideWithApp.
189 void HideWithoutMarkingHidden(); 194 void HideWithoutMarkingHidden();
190 195
191 apps::AppWindow* app_window_; // weak - AppWindow owns NativeAppWindow. 196 apps::AppWindow* app_window_; // weak - AppWindow owns NativeAppWindow.
192 197
193 bool has_frame_; 198 bool has_frame_;
194 199
195 // Whether this window is hidden according to the app.window API. This is set 200 // Whether this window is hidden according to the app.window API. This is set
196 // by Hide, Show, and ShowInactive. 201 // by Hide, Show, and ShowInactive.
197 bool is_hidden_; 202 bool is_hidden_;
198 // Whether this window last became hidden due to a request to hide the entire 203 // Whether this window last became hidden due to a request to hide the entire
199 // app, e.g. via the dock menu or Cmd+H. This is set by Hide/ShowWithApp. 204 // app, e.g. via the dock menu or Cmd+H. This is set by Hide/ShowWithApp.
200 bool is_hidden_with_app_; 205 bool is_hidden_with_app_;
201 206
202 bool is_maximized_; 207 bool is_maximized_;
203 bool is_fullscreen_; 208 bool is_fullscreen_;
204 NSRect restored_bounds_; 209 NSRect restored_bounds_;
205 210
211 bool is_resizable_;
206 bool shows_resize_controls_; 212 bool shows_resize_controls_;
207 bool shows_fullscreen_controls_; 213 bool shows_fullscreen_controls_;
208 214
209 apps::SizeConstraints size_constraints_; 215 apps::SizeConstraints size_constraints_;
210 216
211 base::scoped_nsobject<NativeAppWindowController> window_controller_; 217 base::scoped_nsobject<NativeAppWindowController> window_controller_;
212 NSInteger attention_request_id_; // identifier from requestUserAttention 218 NSInteger attention_request_id_; // identifier from requestUserAttention
213 219
214 // Indicates whether system drag or custom drag should be used, depending on 220 // Indicates whether system drag or custom drag should be used, depending on
215 // the complexity of draggable regions. 221 // the complexity of draggable regions.
(...skipping 12 matching lines...) Expand all
228 NSPoint last_mouse_location_; 234 NSPoint last_mouse_location_;
229 235
230 // The Extension Command Registry used to determine which keyboard events to 236 // The Extension Command Registry used to determine which keyboard events to
231 // handle. 237 // handle.
232 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; 238 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_;
233 239
234 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); 240 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa);
235 }; 241 };
236 242
237 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ 243 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698