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 "content/browser/web_contents/aura/overscroll_navigation_overlay.h" | 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
6 | 6 |
7 #include "content/browser/frame_host/navigation_entry_impl.h" | 7 #include "content/browser/frame_host/navigation_entry_impl.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/browser/web_contents/aura/image_window_delegate.h" | 9 #include "content/browser/web_contents/aura/image_window_delegate.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 ui::Layer* OverscrollNavigationOverlay::CreateSlideLayer(int offset) { | 192 ui::Layer* OverscrollNavigationOverlay::CreateSlideLayer(int offset) { |
193 const NavigationControllerImpl& controller = web_contents_->GetController(); | 193 const NavigationControllerImpl& controller = web_contents_->GetController(); |
194 const NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | 194 const NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
195 controller.GetEntryAtOffset(offset)); | 195 controller.GetEntryAtOffset(offset)); |
196 | 196 |
197 gfx::Image image; | 197 gfx::Image image; |
198 if (entry && entry->screenshot().get()) { | 198 if (entry && entry->screenshot().get()) { |
199 std::vector<gfx::ImagePNGRep> image_reps; | 199 std::vector<gfx::ImagePNGRep> image_reps; |
200 image_reps.push_back(gfx::ImagePNGRep(entry->screenshot(), | 200 image_reps.push_back(gfx::ImagePNGRep(entry->screenshot(), 1.0f)); |
201 ui::GetScaleFactorForNativeView(window_.get()))); | |
202 image = gfx::Image(image_reps); | 201 image = gfx::Image(image_reps); |
203 } | 202 } |
204 if (!layer_delegate_) | 203 if (!layer_delegate_) |
205 layer_delegate_.reset(new ImageLayerDelegate()); | 204 layer_delegate_.reset(new ImageLayerDelegate()); |
206 layer_delegate_->SetImage(image); | 205 layer_delegate_->SetImage(image); |
207 | 206 |
208 ui::Layer* layer = new ui::Layer(ui::LAYER_TEXTURED); | 207 ui::Layer* layer = new ui::Layer(ui::LAYER_TEXTURED); |
209 layer->set_delegate(layer_delegate_.get()); | 208 layer->set_delegate(layer_delegate_.get()); |
210 return layer; | 209 return layer; |
211 } | 210 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // pending entry has been created. | 292 // pending entry has been created. |
294 int committed_entry_id = | 293 int committed_entry_id = |
295 web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID(); | 294 web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID(); |
296 if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) { | 295 if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) { |
297 loading_complete_ = true; | 296 loading_complete_ = true; |
298 StopObservingIfDone(); | 297 StopObservingIfDone(); |
299 } | 298 } |
300 } | 299 } |
301 | 300 |
302 } // namespace content | 301 } // namespace content |
OLD | NEW |