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/web_contents/aura/image_window_delegate.h" | 8 #include "content/browser/web_contents/aura/image_window_delegate.h" |
9 #include "content/browser/web_contents/web_contents_view.h" | 9 #include "content/browser/web_contents/web_contents_view.h" |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 std::vector<unsigned char> png_data; | 38 std::vector<unsigned char> png_data; |
39 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data); | 39 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data); |
40 scoped_refptr<base::RefCountedBytes> png_bytes = | 40 scoped_refptr<base::RefCountedBytes> png_bytes = |
41 base::RefCountedBytes::TakeVector(&png_data); | 41 base::RefCountedBytes::TakeVector(&png_data); |
42 NavigationEntryImpl* entry_impl = | 42 NavigationEntryImpl* entry_impl = |
43 NavigationEntryImpl::FromNavigationEntry(entry); | 43 NavigationEntryImpl::FromNavigationEntry(entry); |
44 entry_impl->SetScreenshotPNGData(png_bytes); | 44 entry_impl->SetScreenshotPNGData(png_bytes); |
45 } | 45 } |
46 | 46 |
47 void ReceivePaintUpdate() { | 47 void ReceivePaintUpdate() { |
48 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg( | 48 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg(test_rvh()->GetRoutingID()); |
49 test_rvh()->GetRoutingID(), 0); | |
50 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); | 49 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); |
51 } | 50 } |
52 | 51 |
53 void PerformBackNavigationViaSliderCallbacks() { | 52 void PerformBackNavigationViaSliderCallbacks() { |
54 // Sets slide direction to SLIDE_BACK, sets screenshot from NavEntry at | 53 // Sets slide direction to SLIDE_BACK, sets screenshot from NavEntry at |
55 // offset -1 on layer_delegate_. | 54 // offset -1 on layer_delegate_. |
56 delete GetOverlay()->CreateBackLayer(); | 55 delete GetOverlay()->CreateBackLayer(); |
57 // Performs BACK navigation, sets image from layer_delegate_ on | 56 // Performs BACK navigation, sets image from layer_delegate_ on |
58 // image_delegate_. | 57 // image_delegate_. |
59 GetOverlay()->OnWindowSlideCompleting(); | 58 GetOverlay()->OnWindowSlideCompleting(); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // Navigation was committed and the load update was received - the flag | 215 // Navigation was committed and the load update was received - the flag |
217 // should now be updated. | 216 // should now be updated. |
218 EXPECT_TRUE(GetOverlay()->loading_complete_); | 217 EXPECT_TRUE(GetOverlay()->loading_complete_); |
219 | 218 |
220 EXPECT_TRUE(GetOverlay()->web_contents()); | 219 EXPECT_TRUE(GetOverlay()->web_contents()); |
221 ReceivePaintUpdate(); | 220 ReceivePaintUpdate(); |
222 EXPECT_FALSE(GetOverlay()->web_contents()); | 221 EXPECT_FALSE(GetOverlay()->web_contents()); |
223 } | 222 } |
224 | 223 |
225 } // namespace content | 224 } // namespace content |
OLD | NEW |