| 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" | |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 11 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| 12 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/render_widget_host_view.h" | 12 #include "content/public/browser/render_widget_host_view.h" |
| 14 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/aura_extra/image_window_delegate.h" |
| 15 #include "ui/base/layout.h" | 15 #include "ui/base/layout.h" |
| 16 #include "ui/compositor/layer.h" | 16 #include "ui/compositor/layer.h" |
| 17 #include "ui/compositor/layer_animation_observer.h" | 17 #include "ui/compositor/layer_animation_observer.h" |
| 18 #include "ui/compositor/scoped_layer_animation_settings.h" | 18 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 19 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
| 20 #include "ui/gfx/image/image_png_rep.h" | 20 #include "ui/gfx/image/image_png_rep.h" |
| 21 #include "ui/gfx/image/image_skia.h" | 21 #include "ui/gfx/image/image_skia.h" |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 namespace { | 24 namespace { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 NavigationEntry* pending_entry = | 155 NavigationEntry* pending_entry = |
| 156 web_contents_->GetController().GetPendingEntry(); | 156 web_contents_->GetController().GetPendingEntry(); |
| 157 // Save url of the pending entry to identify when it loads and paints later. | 157 // Save url of the pending entry to identify when it loads and paints later. |
| 158 // Under some circumstances navigation can leave a null pending entry - | 158 // Under some circumstances navigation can leave a null pending entry - |
| 159 // see comments in NavigationControllerImpl::NavigateToPendingEntry(). | 159 // see comments in NavigationControllerImpl::NavigateToPendingEntry(). |
| 160 pending_entry_url_ = pending_entry ? pending_entry->GetURL() : GURL(); | 160 pending_entry_url_ = pending_entry ? pending_entry->GetURL() : GURL(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void OverscrollNavigationOverlay::SetOverlayWindow( | 163 void OverscrollNavigationOverlay::SetOverlayWindow( |
| 164 scoped_ptr<aura::Window> window, | 164 scoped_ptr<aura::Window> window, |
| 165 ImageWindowDelegate* delegate) { | 165 aura_extra::ImageWindowDelegate* delegate) { |
| 166 window_ = window.Pass(); | 166 window_ = window.Pass(); |
| 167 if (window_.get() && window_->parent()) | 167 if (window_.get() && window_->parent()) |
| 168 window_->parent()->StackChildAtTop(window_.get()); | 168 window_->parent()->StackChildAtTop(window_.get()); |
| 169 image_delegate_ = delegate; | 169 image_delegate_ = delegate; |
| 170 | 170 |
| 171 if (window_.get() && delegate->has_image()) { | 171 if (window_.get() && delegate->has_image()) { |
| 172 window_slider_.reset(new WindowSlider(this, | 172 window_slider_.reset(new WindowSlider(this, |
| 173 window_->parent(), | 173 window_->parent(), |
| 174 window_.get())); | 174 window_.get())); |
| 175 slide_direction_ = SLIDE_UNKNOWN; | 175 slide_direction_ = SLIDE_UNKNOWN; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 void OverscrollNavigationOverlay::DidStopLoading(RenderViewHost* host) { | 308 void OverscrollNavigationOverlay::DidStopLoading(RenderViewHost* host) { |
| 309 // Don't compare URLs in this case - it's possible they won't match if | 309 // Don't compare URLs in this case - it's possible they won't match if |
| 310 // a gesture-nav initiated navigation was interrupted by some other in-site | 310 // a gesture-nav initiated navigation was interrupted by some other in-site |
| 311 // navigation ((e.g., from a script, or from a bookmark). | 311 // navigation ((e.g., from a script, or from a bookmark). |
| 312 loading_complete_ = true; | 312 loading_complete_ = true; |
| 313 StopObservingIfDone(); | 313 StopObservingIfDone(); |
| 314 } | 314 } |
| 315 | 315 |
| 316 } // namespace content | 316 } // namespace content |
| OLD | NEW |