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 "chrome/browser/ui/views/frame/contents_web_view.h" | 5 #include "chrome/browser/ui/views/frame/contents_web_view.h" |
6 | 6 |
7 #include "chrome/browser/themes/theme_properties.h" | 7 #include "chrome/browser/themes/theme_properties.h" |
8 #include "chrome/browser/ui/views/status_bubble_views.h" | 8 #include "chrome/browser/ui/views/status_bubble_views.h" |
9 #include "content/public/browser/render_widget_host_view.h" | 9 #include "content/public/browser/render_widget_host_view.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 old_layer->Add(cloned_layer_tree_->release()); | 91 old_layer->Add(cloned_layer_tree_->release()); |
92 cloned_layer_tree_.reset(); | 92 cloned_layer_tree_.reset(); |
93 } | 93 } |
94 | 94 |
95 void ContentsWebView::CloneWebContentsLayer() { | 95 void ContentsWebView::CloneWebContentsLayer() { |
96 if (!web_contents()) | 96 if (!web_contents()) |
97 return; | 97 return; |
98 #if defined(USE_AURA) | 98 #if defined(USE_AURA) |
99 // We don't need to clone the layers on non-Aura (Mac), because closing an | 99 // We don't need to clone the layers on non-Aura (Mac), because closing an |
100 // NSWindow does not animate. | 100 // NSWindow does not animate. |
101 cloned_layer_tree_ = | 101 cloned_layer_tree_ = wm::RecreateLayers(web_contents()->GetNativeView()); |
102 wm::RecreateLayers(web_contents()->GetNativeView(), nullptr); | |
103 #endif | 102 #endif |
104 if (!cloned_layer_tree_ || !cloned_layer_tree_->root()) { | 103 if (!cloned_layer_tree_ || !cloned_layer_tree_->root()) { |
105 cloned_layer_tree_.reset(); | 104 cloned_layer_tree_.reset(); |
106 return; | 105 return; |
107 } | 106 } |
108 | 107 |
109 SetPaintToLayer(true); | 108 SetPaintToLayer(true); |
110 set_layer_owner_delegate(this); | 109 set_layer_owner_delegate(this); |
111 | 110 |
112 // The cloned layer is in a different coordinate system them our layer (which | 111 // The cloned layer is in a different coordinate system them our layer (which |
(...skipping 10 matching lines...) Expand all Loading... |
123 cloned_layer_tree_.reset(); | 122 cloned_layer_tree_.reset(); |
124 SetPaintToLayer(false); | 123 SetPaintToLayer(false); |
125 set_layer_owner_delegate(nullptr); | 124 set_layer_owner_delegate(nullptr); |
126 } | 125 } |
127 | 126 |
128 void ContentsWebView::RenderViewReady() { | 127 void ContentsWebView::RenderViewReady() { |
129 // Apply the theme color to be the default background on startup. | 128 // Apply the theme color to be the default background on startup. |
130 OnThemeChanged(); | 129 OnThemeChanged(); |
131 WebView::RenderViewReady(); | 130 WebView::RenderViewReady(); |
132 } | 131 } |
OLD | NEW |