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

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: Fixed file modes for test files 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 maximum_size.set_width(*options->max_width); 243 maximum_size.set_width(*options->max_width);
243 if (options->max_height.get()) 244 if (options->max_height.get())
244 maximum_size.set_height(*options->max_height); 245 maximum_size.set_height(*options->max_height);
245 246
246 if (options->hidden.get()) 247 if (options->hidden.get())
247 create_params.hidden = *options->hidden.get(); 248 create_params.hidden = *options->hidden.get();
248 249
249 if (options->resizable.get()) 250 if (options->resizable.get())
250 create_params.resizable = *options->resizable.get(); 251 create_params.resizable = *options->resizable.get();
251 252
253 if (GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV &&
254 options->always_on_top.get()) {
255 create_params.always_on_top = *options->always_on_top.get();
256 }
257
252 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) { 258 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) {
253 switch (options->state) { 259 switch (options->state) {
254 case extensions::api::app_window::STATE_NONE: 260 case extensions::api::app_window::STATE_NONE:
255 case extensions::api::app_window::STATE_NORMAL: 261 case extensions::api::app_window::STATE_NORMAL:
256 break; 262 break;
257 case extensions::api::app_window::STATE_FULLSCREEN: 263 case extensions::api::app_window::STATE_FULLSCREEN:
258 create_params.state = ui::SHOW_STATE_FULLSCREEN; 264 create_params.state = ui::SHOW_STATE_FULLSCREEN;
259 break; 265 break;
260 case extensions::api::app_window::STATE_MAXIMIZED: 266 case extensions::api::app_window::STATE_MAXIMIZED:
261 create_params.state = ui::SHOW_STATE_MAXIMIZED; 267 create_params.state = ui::SHOW_STATE_MAXIMIZED;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 HadDevToolsAttached(created_view)) { 327 HadDevToolsAttached(created_view)) {
322 new DevToolsRestorer(this, created_view); 328 new DevToolsRestorer(this, created_view);
323 return true; 329 return true;
324 } 330 }
325 331
326 SendResponse(true); 332 SendResponse(true);
327 return true; 333 return true;
328 } 334 }
329 335
330 } // namespace extensions 336 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698