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

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: Merge 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 maximum_size.set_width(*options->max_width); 240 maximum_size.set_width(*options->max_width);
240 if (options->max_height.get()) 241 if (options->max_height.get())
241 maximum_size.set_height(*options->max_height); 242 maximum_size.set_height(*options->max_height);
242 243
243 if (options->hidden.get()) 244 if (options->hidden.get())
244 create_params.hidden = *options->hidden.get(); 245 create_params.hidden = *options->hidden.get();
245 246
246 if (options->resizable.get()) 247 if (options->resizable.get())
247 create_params.resizable = *options->resizable.get(); 248 create_params.resizable = *options->resizable.get();
248 249
250 if (GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV &&
251 options->always_on_top.get()) {
252 create_params.always_on_top = *options->always_on_top.get();
253 }
254
249 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) { 255 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) {
250 switch (options->state) { 256 switch (options->state) {
251 case extensions::api::app_window::STATE_NONE: 257 case extensions::api::app_window::STATE_NONE:
252 case extensions::api::app_window::STATE_NORMAL: 258 case extensions::api::app_window::STATE_NORMAL:
253 break; 259 break;
254 case extensions::api::app_window::STATE_FULLSCREEN: 260 case extensions::api::app_window::STATE_FULLSCREEN:
255 create_params.state = ui::SHOW_STATE_FULLSCREEN; 261 create_params.state = ui::SHOW_STATE_FULLSCREEN;
256 break; 262 break;
257 case extensions::api::app_window::STATE_MAXIMIZED: 263 case extensions::api::app_window::STATE_MAXIMIZED:
258 create_params.state = ui::SHOW_STATE_MAXIMIZED; 264 create_params.state = ui::SHOW_STATE_MAXIMIZED;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 HadDevToolsAttached(created_view)) { 301 HadDevToolsAttached(created_view)) {
296 new DevToolsRestorer(this, created_view); 302 new DevToolsRestorer(this, created_view);
297 return true; 303 return true;
298 } 304 }
299 305
300 SendResponse(true); 306 SendResponse(true);
301 return true; 307 return true;
302 } 308 }
303 309
304 } // namespace extensions 310 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698