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

Side by Side Diff: chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_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_current_window_internal/app_current_ window_internal_api.h" 5 #include "chrome/browser/extensions/api/app_current_window_internal/app_current_ window_internal_api.h"
6 6
7 #include "apps/native_app_window.h" 7 #include "apps/native_app_window.h"
8 #include "apps/shell_window.h" 8 #include "apps/shell_window.h"
9 #include "apps/shell_window_registry.h" 9 #include "apps/shell_window_registry.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/common/extensions/api/app_current_window_internal.h" 12 #include "chrome/common/extensions/api/app_current_window_internal.h"
13 #include "chrome/common/extensions/api/app_window.h" 13 #include "chrome/common/extensions/api/app_window.h"
14 #include "chrome/common/extensions/features/feature_channel.h" 14 #include "chrome/common/extensions/features/feature_channel.h"
15 #include "chrome/common/extensions/features/simple_feature.h" 15 #include "chrome/common/extensions/features/simple_feature.h"
16 #include "extensions/common/switches.h" 16 #include "extensions/common/switches.h"
17 #include "third_party/skia/include/core/SkRegion.h" 17 #include "third_party/skia/include/core/SkRegion.h"
18 18
19 namespace SetBounds = extensions::api::app_current_window_internal::SetBounds; 19 namespace SetBounds = extensions::api::app_current_window_internal::SetBounds;
20 namespace SetIcon = extensions::api::app_current_window_internal::SetIcon; 20 namespace SetIcon = extensions::api::app_current_window_internal::SetIcon;
21 namespace SetInputRegion = 21 namespace SetInputRegion =
22 extensions::api::app_current_window_internal::SetInputRegion; 22 extensions::api::app_current_window_internal::SetInputRegion;
23 namespace SetAlwaysOnTop =
24 extensions::api::app_current_window_internal::SetAlwaysOnTop;
23 25
24 using apps::ShellWindow; 26 using apps::ShellWindow;
25 using extensions::api::app_current_window_internal::Bounds; 27 using extensions::api::app_current_window_internal::Bounds;
26 using extensions::api::app_current_window_internal::Region; 28 using extensions::api::app_current_window_internal::Region;
27 using extensions::api::app_current_window_internal::RegionRect; 29 using extensions::api::app_current_window_internal::RegionRect;
28 30
29 namespace extensions { 31 namespace extensions {
30 32
31 namespace { 33 namespace {
32 34
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 197 }
196 } else { 198 } else {
197 region.reset(NULL); 199 region.reset(NULL);
198 } 200 }
199 201
200 window->UpdateInputRegion(region.Pass()); 202 window->UpdateInputRegion(region.Pass());
201 203
202 return true; 204 return true;
203 } 205 }
204 206
207 bool AppCurrentWindowInternalSetAlwaysOnTopFunction::RunWithWindow(
208 ShellWindow* window) {
209 if (GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV) {
benwells 2013/10/09 02:00:50 Can we use _api_features.json for this check?
tmdiep 2013/10/09 06:18:08 Done.
210 error_ = kDevChannelOnly;
211 return false;
212 }
213
214 scoped_ptr<SetAlwaysOnTop::Params> params(
215 SetAlwaysOnTop::Params::Create(*args_));
216 CHECK(params.get());
217 window->GetBaseWindow()->SetAlwaysOnTop(params->always_on_top);
218 return true;
219 }
220
205 } // namespace extensions 221 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698