| OLD | NEW |
| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/extensions/api/app_current_window_internal.h" | 9 #include "chrome/common/extensions/api/app_current_window_internal.h" |
| 10 #include "chrome/common/extensions/features/feature_channel.h" | 10 #include "chrome/common/extensions/features/feature_channel.h" |
| 11 #include "extensions/browser/app_window/app_window.h" | 11 #include "extensions/browser/app_window/app_window.h" |
| 12 #include "extensions/browser/app_window/app_window_registry.h" | 12 #include "extensions/browser/app_window/app_window_registry.h" |
| 13 #include "extensions/browser/app_window/native_app_window.h" | 13 #include "extensions/browser/app_window/native_app_window.h" |
| 14 #include "extensions/browser/app_window/size_constraints.h" | 14 #include "extensions/browser/app_window/size_constraints.h" |
| 15 #include "extensions/common/features/simple_feature.h" | 15 #include "extensions/common/features/simple_feature.h" |
| 16 #include "extensions/common/permissions/permissions_data.h" | 16 #include "extensions/common/permissions/permissions_data.h" |
| 17 #include "extensions/common/switches.h" | 17 #include "extensions/common/switches.h" |
| 18 #include "third_party/skia/include/core/SkRegion.h" | 18 #include "third_party/skia/include/core/SkRegion.h" |
| 19 | 19 |
| 20 namespace app_current_window_internal = | 20 namespace app_current_window_internal = |
| 21 extensions::api::app_current_window_internal; | 21 extensions::api::app_current_window_internal; |
| 22 | 22 |
| 23 namespace Show = app_current_window_internal::Show; | 23 namespace Show = app_current_window_internal::Show; |
| 24 namespace SetBounds = app_current_window_internal::SetBounds; | 24 namespace SetBounds = app_current_window_internal::SetBounds; |
| 25 namespace SetSizeConstraints = app_current_window_internal::SetSizeConstraints; | 25 namespace SetSizeConstraints = app_current_window_internal::SetSizeConstraints; |
| 26 namespace SetIcon = app_current_window_internal::SetIcon; | 26 namespace SetIcon = app_current_window_internal::SetIcon; |
| 27 namespace SetBadgeIcon = app_current_window_internal::SetBadgeIcon; | 27 namespace SetBadgeIcon = app_current_window_internal::SetBadgeIcon; |
| 28 namespace SetShape = app_current_window_internal::SetShape; | 28 namespace SetShape = app_current_window_internal::SetShape; |
| 29 namespace SetAlwaysOnTop = app_current_window_internal::SetAlwaysOnTop; | 29 namespace SetAlwaysOnTop = app_current_window_internal::SetAlwaysOnTop; |
| 30 namespace SetVisibleOnAllWorkspaces = |
| 31 app_current_window_internal::SetVisibleOnAllWorkspaces; |
| 30 | 32 |
| 31 using app_current_window_internal::Bounds; | 33 using app_current_window_internal::Bounds; |
| 32 using app_current_window_internal::Region; | 34 using app_current_window_internal::Region; |
| 33 using app_current_window_internal::RegionRect; | 35 using app_current_window_internal::RegionRect; |
| 34 using app_current_window_internal::SizeConstraints; | 36 using app_current_window_internal::SizeConstraints; |
| 35 | 37 |
| 36 namespace extensions { | 38 namespace extensions { |
| 37 | 39 |
| 38 namespace { | 40 namespace { |
| 39 | 41 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 return false; | 392 return false; |
| 391 } | 393 } |
| 392 | 394 |
| 393 scoped_ptr<SetAlwaysOnTop::Params> params( | 395 scoped_ptr<SetAlwaysOnTop::Params> params( |
| 394 SetAlwaysOnTop::Params::Create(*args_)); | 396 SetAlwaysOnTop::Params::Create(*args_)); |
| 395 CHECK(params.get()); | 397 CHECK(params.get()); |
| 396 window->SetAlwaysOnTop(params->always_on_top); | 398 window->SetAlwaysOnTop(params->always_on_top); |
| 397 return true; | 399 return true; |
| 398 } | 400 } |
| 399 | 401 |
| 402 bool AppCurrentWindowInternalSetVisibleOnAllWorkspacesFunction::RunWithWindow( |
| 403 AppWindow* window) { |
| 404 if (GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV) { |
| 405 error_ = kDevChannelOnly; |
| 406 return false; |
| 407 } |
| 408 |
| 409 scoped_ptr<SetVisibleOnAllWorkspaces::Params> params( |
| 410 SetVisibleOnAllWorkspaces::Params::Create(*args_)); |
| 411 CHECK(params.get()); |
| 412 window->GetBaseWindow()->SetVisibleOnAllWorkspaces(params->always_visible); |
| 413 return true; |
| 414 } |
| 415 |
| 400 } // namespace extensions | 416 } // namespace extensions |
| OLD | NEW |