| 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 <vector> | 7 #include <vector> |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "content/browser/frame_host/navigation_entry_impl.h" | 9 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 10 #include "content/browser/web_contents/web_contents_view.h" | 10 #include "content/browser/web_contents/web_contents_view.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 std::vector<unsigned char> png_data; | 91 std::vector<unsigned char> png_data; |
| 92 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data); | 92 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data); |
| 93 scoped_refptr<base::RefCountedBytes> png_bytes = | 93 scoped_refptr<base::RefCountedBytes> png_bytes = |
| 94 base::RefCountedBytes::TakeVector(&png_data); | 94 base::RefCountedBytes::TakeVector(&png_data); |
| 95 NavigationEntryImpl* entry_impl = | 95 NavigationEntryImpl* entry_impl = |
| 96 NavigationEntryImpl::FromNavigationEntry(entry); | 96 NavigationEntryImpl::FromNavigationEntry(entry); |
| 97 entry_impl->SetScreenshotPNGData(png_bytes); | 97 entry_impl->SetScreenshotPNGData(png_bytes); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void ReceivePaintUpdate() { | 100 void ReceivePaintUpdate() { |
| 101 FrameHostMsg_DidFirstVisuallyNonEmptyPaint msg( | 101 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg( |
| 102 main_test_rfh()->GetRoutingID()); | 102 main_test_rfh()->GetRoutingID()); |
| 103 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); | 103 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void PerformBackNavigationViaSliderCallbacks() { | 106 void PerformBackNavigationViaSliderCallbacks() { |
| 107 // Sets slide direction to BACK, sets screenshot from NavEntry at | 107 // Sets slide direction to BACK, sets screenshot from NavEntry at |
| 108 // offset -1 on layer_delegate_. | 108 // offset -1 on layer_delegate_. |
| 109 scoped_ptr<aura::Window> window( | 109 scoped_ptr<aura::Window> window( |
| 110 GetOverlay()->CreateBackWindow(GetBackSlideWindowBounds())); | 110 GetOverlay()->CreateBackWindow(GetBackSlideWindowBounds())); |
| 111 bool window_created = window; | 111 bool window_created = window; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 EXPECT_TRUE(GetOverlay()->window_.get()); | 405 EXPECT_TRUE(GetOverlay()->window_.get()); |
| 406 | 406 |
| 407 // Load the page. | 407 // Load the page. |
| 408 contents()->CommitPendingNavigation(); | 408 contents()->CommitPendingNavigation(); |
| 409 ReceivePaintUpdate(); | 409 ReceivePaintUpdate(); |
| 410 EXPECT_FALSE(GetOverlay()->window_.get()); | 410 EXPECT_FALSE(GetOverlay()->window_.get()); |
| 411 EXPECT_EQ(contents()->GetURL(), first()); | 411 EXPECT_EQ(contents()->GetURL(), first()); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace content | 414 } // namespace content |
| OLD | NEW |