OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 : WebContentsObserver(shell->web_contents()), | 151 : WebContentsObserver(shell->web_contents()), |
152 shell_(shell), | 152 shell_(shell), |
153 wcv_new_size_(wcv_new_size) { | 153 wcv_new_size_(wcv_new_size) { |
154 } | 154 } |
155 | 155 |
156 // WebContentsObserver: | 156 // WebContentsObserver: |
157 void RenderViewCreated(RenderViewHost* rvh) override { | 157 void RenderViewCreated(RenderViewHost* rvh) override { |
158 rwhv_create_size_ = rvh->GetWidget()->GetView()->GetViewBounds().size(); | 158 rwhv_create_size_ = rvh->GetWidget()->GetView()->GetViewBounds().size(); |
159 } | 159 } |
160 | 160 |
161 void DidStartProvisionalLoadForFrame( | 161 void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host, |
162 RenderFrameHost* render_frame_host, | 162 const GURL& url, |
163 const GURL& url, | 163 bool is_error_page) override { |
164 bool is_error_page, | |
165 bool is_iframe_srcdoc) override { | |
166 ResizeWebContentsView(shell_, wcv_new_size_, false); | 164 ResizeWebContentsView(shell_, wcv_new_size_, false); |
167 } | 165 } |
168 | 166 |
169 gfx::Size rwhv_create_size() const { return rwhv_create_size_; } | 167 gfx::Size rwhv_create_size() const { return rwhv_create_size_; } |
170 | 168 |
171 private: | 169 private: |
172 Shell* shell_; // Weak ptr. | 170 Shell* shell_; // Weak ptr. |
173 gfx::Size wcv_new_size_; | 171 gfx::Size wcv_new_size_; |
174 gfx::Size rwhv_create_size_; | 172 gfx::Size rwhv_create_size_; |
175 }; | 173 }; |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 // Make sure the WebContents cleaned up the previous pending request. A new | 1296 // Make sure the WebContents cleaned up the previous pending request. A new |
1299 // request should be forwarded to the WebContentsDelegate. | 1297 // request should be forwarded to the WebContentsDelegate. |
1300 delegate.get()->request_to_lock_mouse_called_ = false; | 1298 delegate.get()->request_to_lock_mouse_called_ = false; |
1301 ASSERT_TRUE(ExecuteScript(shell(), | 1299 ASSERT_TRUE(ExecuteScript(shell(), |
1302 "window.domAutomationController.send(document.body." | 1300 "window.domAutomationController.send(document.body." |
1303 "requestPointerLock());")); | 1301 "requestPointerLock());")); |
1304 EXPECT_TRUE(delegate.get()->request_to_lock_mouse_called_); | 1302 EXPECT_TRUE(delegate.get()->request_to_lock_mouse_called_); |
1305 } | 1303 } |
1306 | 1304 |
1307 } // namespace content | 1305 } // namespace content |
OLD | NEW |