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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1915 static const size_t kTotalViews = 2; | 1915 static const size_t kTotalViews = 2; |
1916 std::vector<NotificationInfo> notifications_; | 1916 std::vector<NotificationInfo> notifications_; |
1917 }; | 1917 }; |
1918 | 1918 |
1919 class TestChangeNativeViewHierarchy { | 1919 class TestChangeNativeViewHierarchy { |
1920 public: | 1920 public: |
1921 explicit TestChangeNativeViewHierarchy(ViewTest *view_test) { | 1921 explicit TestChangeNativeViewHierarchy(ViewTest *view_test) { |
1922 view_test_ = view_test; | 1922 view_test_ = view_test; |
1923 native_host_ = new NativeViewHost(); | 1923 native_host_ = new NativeViewHost(); |
1924 host_ = new Widget; | 1924 host_ = new Widget; |
1925 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); | 1925 Widget::InitParams params = |
| 1926 view_test->CreateParams(Widget::InitParams::TYPE_POPUP); |
1926 params.bounds = gfx::Rect(0, 0, 500, 300); | 1927 params.bounds = gfx::Rect(0, 0, 500, 300); |
1927 host_->Init(params); | 1928 host_->Init(params); |
1928 host_->GetRootView()->AddChildView(native_host_); | 1929 host_->GetRootView()->AddChildView(native_host_); |
1929 for (size_t i = 0; i < TestNativeViewHierarchy::kTotalViews; ++i) { | 1930 for (size_t i = 0; i < TestNativeViewHierarchy::kTotalViews; ++i) { |
1930 windows_[i] = new Widget; | 1931 windows_[i] = new Widget; |
1931 Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); | 1932 Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); |
1932 params.parent = host_->GetNativeView(); | 1933 params.parent = host_->GetNativeView(); |
1933 params.bounds = gfx::Rect(0, 0, 500, 300); | 1934 params.bounds = gfx::Rect(0, 0, 500, 300); |
1934 windows_[i]->Init(params); | 1935 windows_[i]->Init(params); |
1935 root_views_[i] = windows_[i]->GetRootView(); | 1936 root_views_[i] = windows_[i]->GetRootView(); |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3404 // Set to non default value. | 3405 // Set to non default value. |
3405 v->layer()->set_scale_content(false); | 3406 v->layer()->set_scale_content(false); |
3406 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); | 3407 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); |
3407 ui::Layer* new_layer = v->layer(); | 3408 ui::Layer* new_layer = v->layer(); |
3408 EXPECT_FALSE(new_layer->scale_content()); | 3409 EXPECT_FALSE(new_layer->scale_content()); |
3409 } | 3410 } |
3410 | 3411 |
3411 #endif // USE_AURA | 3412 #endif // USE_AURA |
3412 | 3413 |
3413 } // namespace views | 3414 } // namespace views |
OLD | NEW |