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

Side by Side Diff: chrome/browser/ui/extensions/shell_window.h

Issue 13609003: fullscreen in apps v2 ShellWindow via app.window.create. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_EXTENSIONS_SHELL_WINDOW_H_ 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/extensions/extension_keybinding_registry.h" 10 #include "chrome/browser/extensions/extension_keybinding_registry.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 gfx::Rect bounds; 93 gfx::Rect bounds;
94 94
95 gfx::Size minimum_size; 95 gfx::Size minimum_size;
96 gfx::Size maximum_size; 96 gfx::Size maximum_size;
97 97
98 std::string window_key; 98 std::string window_key;
99 99
100 // The process ID of the process that requested the create. 100 // The process ID of the process that requested the create.
101 int32 creator_process_id; 101 int32 creator_process_id;
102 102
103 enum State {
104 STATE_NORMAL,
105 STATE_FULLSCREEN,
106 STATE_MAXIMIZED,
107 STATE_MINIMIZED
108 };
109
110 // Initial state of the window.
111 State state;
112
103 // If true, don't show the window after creation. 113 // If true, don't show the window after creation.
104 bool hidden; 114 bool hidden;
105 115
106 // If true, the window will be resizable by the user. Defaults to true. 116 // If true, the window will be resizable by the user. Defaults to true.
107 bool resizable; 117 bool resizable;
108 118
109 // If true, the window will be focused on creation. Defaults to true. 119 // If true, the window will be focused on creation. Defaults to true.
110 bool focused; 120 bool focused;
111 }; 121 };
112 122
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 void SetAppIconUrl(const GURL& icon_url); 182 void SetAppIconUrl(const GURL& icon_url);
173 183
174 // Called from the render interface to modify the draggable regions. 184 // Called from the render interface to modify the draggable regions.
175 void UpdateDraggableRegions( 185 void UpdateDraggableRegions(
176 const std::vector<extensions::DraggableRegion>& regions); 186 const std::vector<extensions::DraggableRegion>& regions);
177 187
178 // Updates the app image to |image|. Called internally from the image loader 188 // Updates the app image to |image|. Called internally from the image loader
179 // callback. Also called externally for v1 apps using Ash Panels. 189 // callback. Also called externally for v1 apps using Ash Panels.
180 void UpdateAppIcon(const gfx::Image& image); 190 void UpdateAppIcon(const gfx::Image& image);
181 191
192 // Transitions window into fullscreen, maximized, minimized or restores based
193 // on chrome.app.window API.
194 void Fullscreen();
195 void Maximize();
196 void Minimize();
197 void Restore();
198
182 ShellWindowContents* shell_window_contents_for_test() { 199 ShellWindowContents* shell_window_contents_for_test() {
183 return shell_window_contents_.get(); 200 return shell_window_contents_.get();
184 } 201 }
185 202
186 protected: 203 protected:
187 virtual ~ShellWindow(); 204 virtual ~ShellWindow();
188 205
189 private: 206 private:
190 // PlatformAppBrowserTest needs access to web_contents() 207 // PlatformAppBrowserTest needs access to web_contents()
191 friend class extensions::PlatformAppBrowserTest; 208 friend class extensions::PlatformAppBrowserTest;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 287
271 // Icon URL to be used for setting the app icon. If not empty, app_icon_ will 288 // Icon URL to be used for setting the app icon. If not empty, app_icon_ will
272 // be fetched and set using this URL. 289 // be fetched and set using this URL.
273 GURL app_icon_url_; 290 GURL app_icon_url_;
274 291
275 scoped_ptr<NativeAppWindow> native_app_window_; 292 scoped_ptr<NativeAppWindow> native_app_window_;
276 scoped_ptr<ShellWindowContents> shell_window_contents_; 293 scoped_ptr<ShellWindowContents> shell_window_contents_;
277 294
278 base::WeakPtrFactory<ShellWindow> image_loader_ptr_factory_; 295 base::WeakPtrFactory<ShellWindow> image_loader_ptr_factory_;
279 296
297 // Fullscreen entered by app.window api.
298 bool fullscreen_for_window_api_;
299 // Fullscreen entered by HTML requestFullscreen.
300 bool fullscreen_for_tab_;
jeremya 2013/04/05 20:00:35 oh boy :<
scheib 2013/04/05 21:47:52 Done. o|-<
301
280 DISALLOW_COPY_AND_ASSIGN(ShellWindow); 302 DISALLOW_COPY_AND_ASSIGN(ShellWindow);
281 }; 303 };
282 304
283 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ 305 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698