| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 frame(AppWindow::FRAME_CHROME), | 159 frame(AppWindow::FRAME_CHROME), |
| 160 has_frame_color(false), | 160 has_frame_color(false), |
| 161 active_frame_color(SK_ColorBLACK), | 161 active_frame_color(SK_ColorBLACK), |
| 162 inactive_frame_color(SK_ColorBLACK), | 162 inactive_frame_color(SK_ColorBLACK), |
| 163 alpha_enabled(false), | 163 alpha_enabled(false), |
| 164 creator_process_id(0), | 164 creator_process_id(0), |
| 165 state(ui::SHOW_STATE_DEFAULT), | 165 state(ui::SHOW_STATE_DEFAULT), |
| 166 hidden(false), | 166 hidden(false), |
| 167 resizable(true), | 167 resizable(true), |
| 168 focused(true), | 168 focused(true), |
| 169 always_on_top(false) { | 169 always_on_top(false), |
| 170 visible_on_all_workspaces(false) { |
| 170 } | 171 } |
| 171 | 172 |
| 172 AppWindow::CreateParams::~CreateParams() {} | 173 AppWindow::CreateParams::~CreateParams() {} |
| 173 | 174 |
| 174 gfx::Rect AppWindow::CreateParams::GetInitialWindowBounds( | 175 gfx::Rect AppWindow::CreateParams::GetInitialWindowBounds( |
| 175 const gfx::Insets& frame_insets) const { | 176 const gfx::Insets& frame_insets) const { |
| 176 // Combine into a single window bounds. | 177 // Combine into a single window bounds. |
| 177 gfx::Rect combined_bounds(window_spec.bounds); | 178 gfx::Rect combined_bounds(window_spec.bounds); |
| 178 if (content_spec.bounds.x() != BoundsSpecification::kUnspecifiedPosition) | 179 if (content_spec.bounds.x() != BoundsSpecification::kUnspecifiedPosition) |
| 179 combined_bounds.set_x(content_spec.bounds.x() - frame_insets.left()); | 180 combined_bounds.set_x(content_spec.bounds.x() - frame_insets.left()); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 | 729 |
| 729 properties->SetBoolean("fullscreen", | 730 properties->SetBoolean("fullscreen", |
| 730 native_app_window_->IsFullscreenOrPending()); | 731 native_app_window_->IsFullscreenOrPending()); |
| 731 properties->SetBoolean("minimized", native_app_window_->IsMinimized()); | 732 properties->SetBoolean("minimized", native_app_window_->IsMinimized()); |
| 732 properties->SetBoolean("maximized", native_app_window_->IsMaximized()); | 733 properties->SetBoolean("maximized", native_app_window_->IsMaximized()); |
| 733 properties->SetBoolean("alwaysOnTop", IsAlwaysOnTop()); | 734 properties->SetBoolean("alwaysOnTop", IsAlwaysOnTop()); |
| 734 properties->SetBoolean("hasFrameColor", native_app_window_->HasFrameColor()); | 735 properties->SetBoolean("hasFrameColor", native_app_window_->HasFrameColor()); |
| 735 properties->SetBoolean( | 736 properties->SetBoolean( |
| 736 "alphaEnabled", | 737 "alphaEnabled", |
| 737 requested_alpha_enabled_ && native_app_window_->CanHaveAlphaEnabled()); | 738 requested_alpha_enabled_ && native_app_window_->CanHaveAlphaEnabled()); |
| 739 #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 740 properties->SetBoolean("canSetVisibleOnAllWorkspaces", true); |
| 741 #else |
| 742 properties->SetBoolean("canSetVisibleOnAllWorkspaces", false); |
| 743 #endif |
| 738 | 744 |
| 739 // These properties are undocumented and are to enable testing. Alpha is | 745 // These properties are undocumented and are to enable testing. Alpha is |
| 740 // removed to | 746 // removed to |
| 741 // make the values easier to check. | 747 // make the values easier to check. |
| 742 SkColor transparent_white = ~SK_ColorBLACK; | 748 SkColor transparent_white = ~SK_ColorBLACK; |
| 743 properties->SetInteger( | 749 properties->SetInteger( |
| 744 "activeFrameColor", | 750 "activeFrameColor", |
| 745 native_app_window_->ActiveFrameColor() & transparent_white); | 751 native_app_window_->ActiveFrameColor() & transparent_white); |
| 746 properties->SetInteger( | 752 properties->SetInteger( |
| 747 "inactiveFrameColor", | 753 "inactiveFrameColor", |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 region.bounds.x(), | 1110 region.bounds.x(), |
| 1105 region.bounds.y(), | 1111 region.bounds.y(), |
| 1106 region.bounds.right(), | 1112 region.bounds.right(), |
| 1107 region.bounds.bottom(), | 1113 region.bounds.bottom(), |
| 1108 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1114 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 1109 } | 1115 } |
| 1110 return sk_region; | 1116 return sk_region; |
| 1111 } | 1117 } |
| 1112 | 1118 |
| 1113 } // namespace apps | 1119 } // namespace apps |
| OLD | NEW |