Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/webview/webview.h" | 5 #include "ui/views/controls/webview/webview.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_accessibility_state.h" | 7 #include "content/public/browser/browser_accessibility_state.h" |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/navigation_controller.h" | 9 #include "content/public/browser/navigation_controller.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 if (preferred_size_ == gfx::Size()) | 220 if (preferred_size_ == gfx::Size()) |
| 221 return View::GetPreferredSize(); | 221 return View::GetPreferredSize(); |
| 222 else | 222 else |
| 223 return preferred_size_; | 223 return preferred_size_; |
| 224 } | 224 } |
| 225 | 225 |
| 226 //////////////////////////////////////////////////////////////////////////////// | 226 //////////////////////////////////////////////////////////////////////////////// |
| 227 // WebView, content::WebContentsDelegate implementation: | 227 // WebView, content::WebContentsDelegate implementation: |
| 228 | 228 |
| 229 void WebView::WebContentsFocused(content::WebContents* web_contents) { | 229 void WebView::WebContentsFocused(content::WebContents* web_contents) { |
| 230 DCHECK(wc_owner_.get()); | 230 DCHECK(wc_owner_.get()); |
|
flackr
2014/07/18 18:15:08
Do we need this check? We are violating this in at
miu
2014/07/22 00:18:22
The assumption is that WebView is only used as a W
flackr
2014/07/22 00:27:37
I'm guessing at the intentions of Stefan's CL, but
| |
| 231 // The WebView is only the delegate of WebContentses it creates itself. | 231 // The WebView is only the delegate of WebContentses it creates itself. |
| 232 OnWebContentsFocused(wc_owner_.get()); | 232 OnWebContentsFocused(wc_owner_.get()); |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool WebView::EmbedsFullscreenWidget() const { | 235 bool WebView::EmbedsFullscreenWidget() const { |
| 236 DCHECK(wc_owner_.get()); | |
| 237 return embed_fullscreen_widget_mode_enabled_; | 236 return embed_fullscreen_widget_mode_enabled_; |
| 238 } | 237 } |
| 239 | 238 |
| 240 //////////////////////////////////////////////////////////////////////////////// | 239 //////////////////////////////////////////////////////////////////////////////// |
| 241 // WebView, content::WebContentsObserver implementation: | 240 // WebView, content::WebContentsObserver implementation: |
| 242 | 241 |
| 243 void WebView::RenderViewDeleted(content::RenderViewHost* render_view_host) { | 242 void WebView::RenderViewDeleted(content::RenderViewHost* render_view_host) { |
| 244 NotifyMaybeTextInputClientChanged(); | 243 NotifyMaybeTextInputClientChanged(); |
| 245 } | 244 } |
| 246 | 245 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 if (!contents) { | 357 if (!contents) { |
| 359 content::WebContents::CreateParams create_params( | 358 content::WebContents::CreateParams create_params( |
| 360 browser_context, NULL); | 359 browser_context, NULL); |
| 361 return content::WebContents::Create(create_params); | 360 return content::WebContents::Create(create_params); |
| 362 } | 361 } |
| 363 | 362 |
| 364 return contents; | 363 return contents; |
| 365 } | 364 } |
| 366 | 365 |
| 367 } // namespace views | 366 } // namespace views |
| OLD | NEW |