| 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 "apps/app_window_geometry_cache.h" | 7 #include "apps/app_window_geometry_cache.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 minimum_size_ = min_size; | 116 minimum_size_ = min_size; |
| 117 } | 117 } |
| 118 | 118 |
| 119 void AppWindow::SizeConstraints::set_maximum_size(const gfx::Size& max_size) { | 119 void AppWindow::SizeConstraints::set_maximum_size(const gfx::Size& max_size) { |
| 120 maximum_size_ = max_size; | 120 maximum_size_ = max_size; |
| 121 } | 121 } |
| 122 | 122 |
| 123 AppWindow::CreateParams::CreateParams() | 123 AppWindow::CreateParams::CreateParams() |
| 124 : window_type(AppWindow::WINDOW_TYPE_DEFAULT), | 124 : window_type(AppWindow::WINDOW_TYPE_DEFAULT), |
| 125 frame(AppWindow::FRAME_CHROME), | 125 frame(AppWindow::FRAME_CHROME), |
| 126 has_frame_color(false), |
| 126 transparent_background(false), | 127 transparent_background(false), |
| 127 bounds(INT_MIN, INT_MIN, 0, 0), | 128 bounds(INT_MIN, INT_MIN, 0, 0), |
| 128 creator_process_id(0), | 129 creator_process_id(0), |
| 129 state(ui::SHOW_STATE_DEFAULT), | 130 state(ui::SHOW_STATE_DEFAULT), |
| 130 hidden(false), | 131 hidden(false), |
| 131 resizable(true), | 132 resizable(true), |
| 132 focused(true), | 133 focused(true), |
| 133 always_on_top(false) {} | 134 always_on_top(false) {} |
| 134 | 135 |
| 135 AppWindow::CreateParams::~CreateParams() {} | 136 AppWindow::CreateParams::~CreateParams() {} |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 properties->SetBoolean("minimized", native_app_window_->IsMinimized()); | 604 properties->SetBoolean("minimized", native_app_window_->IsMinimized()); |
| 604 properties->SetBoolean("maximized", native_app_window_->IsMaximized()); | 605 properties->SetBoolean("maximized", native_app_window_->IsMaximized()); |
| 605 properties->SetBoolean("alwaysOnTop", IsAlwaysOnTop()); | 606 properties->SetBoolean("alwaysOnTop", IsAlwaysOnTop()); |
| 606 scoped_ptr<base::DictionaryValue> boundsValue(new base::DictionaryValue()); | 607 scoped_ptr<base::DictionaryValue> boundsValue(new base::DictionaryValue()); |
| 607 gfx::Rect bounds = GetClientBounds(); | 608 gfx::Rect bounds = GetClientBounds(); |
| 608 boundsValue->SetInteger("left", bounds.x()); | 609 boundsValue->SetInteger("left", bounds.x()); |
| 609 boundsValue->SetInteger("top", bounds.y()); | 610 boundsValue->SetInteger("top", bounds.y()); |
| 610 boundsValue->SetInteger("width", bounds.width()); | 611 boundsValue->SetInteger("width", bounds.width()); |
| 611 boundsValue->SetInteger("height", bounds.height()); | 612 boundsValue->SetInteger("height", bounds.height()); |
| 612 properties->Set("bounds", boundsValue.release()); | 613 properties->Set("bounds", boundsValue.release()); |
| 614 properties->SetBoolean("hasFrameColor", native_app_window_->HasFrameColor()); |
| 615 properties->SetInteger("frameColor", native_app_window_->FrameColor()); |
| 613 | 616 |
| 614 const SizeConstraints& constraints = size_constraints(); | 617 const SizeConstraints& constraints = size_constraints(); |
| 615 gfx::Size min_size = constraints.GetMinimumSize(); | 618 gfx::Size min_size = constraints.GetMinimumSize(); |
| 616 gfx::Size max_size = constraints.GetMaximumSize(); | 619 gfx::Size max_size = constraints.GetMaximumSize(); |
| 617 if (min_size.width() != SizeConstraints::kUnboundedSize) | 620 if (min_size.width() != SizeConstraints::kUnboundedSize) |
| 618 properties->SetInteger("minWidth", min_size.width()); | 621 properties->SetInteger("minWidth", min_size.width()); |
| 619 if (min_size.height() != SizeConstraints::kUnboundedSize) | 622 if (min_size.height() != SizeConstraints::kUnboundedSize) |
| 620 properties->SetInteger("minHeight", min_size.height()); | 623 properties->SetInteger("minHeight", min_size.height()); |
| 621 if (max_size.width() != SizeConstraints::kUnboundedSize) | 624 if (max_size.width() != SizeConstraints::kUnboundedSize) |
| 622 properties->SetInteger("maxWidth", max_size.width()); | 625 properties->SetInteger("maxWidth", max_size.width()); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 region.bounds.x(), | 968 region.bounds.x(), |
| 966 region.bounds.y(), | 969 region.bounds.y(), |
| 967 region.bounds.right(), | 970 region.bounds.right(), |
| 968 region.bounds.bottom(), | 971 region.bounds.bottom(), |
| 969 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 972 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 970 } | 973 } |
| 971 return sk_region; | 974 return sk_region; |
| 972 } | 975 } |
| 973 | 976 |
| 974 } // namespace apps | 977 } // namespace apps |
| OLD | NEW |