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

Side by Side Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 26427002: Add always-on-top property to app windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache state of isAlwaysOnTop in widget. Fixed clobber in x11 window init. Created 7 years, 2 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 (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 #include "chrome/browser/extensions/api/app_window/app_window_api.h" 5 #include "chrome/browser/extensions/api/app_window/app_window_api.h"
6 6
7 #include "apps/app_window_contents.h" 7 #include "apps/app_window_contents.h"
8 #include "apps/native_app_window.h" 8 #include "apps/native_app_window.h"
9 #include "apps/shell_window.h" 9 #include "apps/shell_window.h"
10 #include "apps/shell_window_registry.h" 10 #include "apps/shell_window_registry.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 private: 86 private:
87 scoped_refptr<AppWindowCreateFunction> delayed_create_function_; 87 scoped_refptr<AppWindowCreateFunction> delayed_create_function_;
88 content::NotificationRegistrar registrar_; 88 content::NotificationRegistrar registrar_;
89 }; 89 };
90 90
91 void SetCreateResultFromShellWindow(ShellWindow* window, 91 void SetCreateResultFromShellWindow(ShellWindow* window,
92 base::DictionaryValue* result) { 92 base::DictionaryValue* result) {
93 result->SetBoolean("fullscreen", window->GetBaseWindow()->IsFullscreen()); 93 result->SetBoolean("fullscreen", window->GetBaseWindow()->IsFullscreen());
94 result->SetBoolean("minimized", window->GetBaseWindow()->IsMinimized()); 94 result->SetBoolean("minimized", window->GetBaseWindow()->IsMinimized());
95 result->SetBoolean("maximized", window->GetBaseWindow()->IsMaximized()); 95 result->SetBoolean("maximized", window->GetBaseWindow()->IsMaximized());
96 result->SetBoolean("alwaysOnTop", window->GetBaseWindow()->IsAlwaysOnTop());
96 base::DictionaryValue* boundsValue = new base::DictionaryValue(); 97 base::DictionaryValue* boundsValue = new base::DictionaryValue();
97 gfx::Rect bounds = window->GetClientBounds(); 98 gfx::Rect bounds = window->GetClientBounds();
98 boundsValue->SetInteger("left", bounds.x()); 99 boundsValue->SetInteger("left", bounds.x());
99 boundsValue->SetInteger("top", bounds.y()); 100 boundsValue->SetInteger("top", bounds.y());
100 boundsValue->SetInteger("width", bounds.width()); 101 boundsValue->SetInteger("width", bounds.width());
101 boundsValue->SetInteger("height", bounds.height()); 102 boundsValue->SetInteger("height", bounds.height());
102 result->Set("bounds", boundsValue); 103 result->Set("bounds", boundsValue);
103 } 104 }
104 105
105 } // namespace 106 } // namespace
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 maximum_size.set_width(*options->max_width); 238 maximum_size.set_width(*options->max_width);
238 if (options->max_height.get()) 239 if (options->max_height.get())
239 maximum_size.set_height(*options->max_height); 240 maximum_size.set_height(*options->max_height);
240 241
241 if (options->hidden.get()) 242 if (options->hidden.get())
242 create_params.hidden = *options->hidden.get(); 243 create_params.hidden = *options->hidden.get();
243 244
244 if (options->resizable.get()) 245 if (options->resizable.get())
245 create_params.resizable = *options->resizable.get(); 246 create_params.resizable = *options->resizable.get();
246 247
248 if (GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV &&
benwells 2013/10/09 02:00:50 It's a pity we can't use _api_features.json for th
249 options->always_on_top.get()) {
250 create_params.always_on_top = *options->always_on_top.get();
251 }
252
247 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) { 253 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) {
248 switch (options->state) { 254 switch (options->state) {
249 case extensions::api::app_window::STATE_NONE: 255 case extensions::api::app_window::STATE_NONE:
250 case extensions::api::app_window::STATE_NORMAL: 256 case extensions::api::app_window::STATE_NORMAL:
251 break; 257 break;
252 case extensions::api::app_window::STATE_FULLSCREEN: 258 case extensions::api::app_window::STATE_FULLSCREEN:
253 create_params.state = ui::SHOW_STATE_FULLSCREEN; 259 create_params.state = ui::SHOW_STATE_FULLSCREEN;
254 break; 260 break;
255 case extensions::api::app_window::STATE_MAXIMIZED: 261 case extensions::api::app_window::STATE_MAXIMIZED:
256 create_params.state = ui::SHOW_STATE_MAXIMIZED; 262 create_params.state = ui::SHOW_STATE_MAXIMIZED;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 HadDevToolsAttached(created_view)) { 299 HadDevToolsAttached(created_view)) {
294 new DevToolsRestorer(this, created_view); 300 new DevToolsRestorer(this, created_view);
295 return true; 301 return true;
296 } 302 }
297 303
298 SendResponse(true); 304 SendResponse(true);
299 return true; 305 return true;
300 } 306 }
301 307
302 } // namespace extensions 308 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698