| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 return; | 235 return; |
| 236 wcv_holder_->Attach(view_to_attach); | 236 wcv_holder_->Attach(view_to_attach); |
| 237 | 237 |
| 238 // The view will not be focused automatically when it is attached, so we need | 238 // The view will not be focused automatically when it is attached, so we need |
| 239 // to pass on focus to it if the FocusManager thinks the view is focused. Note | 239 // to pass on focus to it if the FocusManager thinks the view is focused. Note |
| 240 // that not every Widget has a focus manager. | 240 // that not every Widget has a focus manager. |
| 241 FocusManager* const focus_manager = GetFocusManager(); | 241 FocusManager* const focus_manager = GetFocusManager(); |
| 242 if (focus_manager && focus_manager->GetFocusedView() == this) | 242 if (focus_manager && focus_manager->GetFocusedView() == this) |
| 243 OnFocus(); | 243 OnFocus(); |
| 244 | 244 |
| 245 #if defined(OS_WIN) && defined(USE_AURA) | 245 #if defined(OS_WIN) |
| 246 if (!is_embedding_fullscreen_widget_) { | 246 if (!is_embedding_fullscreen_widget_) { |
| 247 web_contents()->SetParentNativeViewAccessible( | 247 web_contents()->SetParentNativeViewAccessible( |
| 248 parent()->GetNativeViewAccessible()); | 248 parent()->GetNativeViewAccessible()); |
| 249 } | 249 } |
| 250 #endif | 250 #endif |
| 251 } | 251 } |
| 252 | 252 |
| 253 void WebView::DetachWebContents() { | 253 void WebView::DetachWebContents() { |
| 254 if (web_contents()) { | 254 if (web_contents()) { |
| 255 wcv_holder_->Detach(); | 255 wcv_holder_->Detach(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (!contents) { | 290 if (!contents) { |
| 291 content::WebContents::CreateParams create_params( | 291 content::WebContents::CreateParams create_params( |
| 292 browser_context, NULL); | 292 browser_context, NULL); |
| 293 return content::WebContents::Create(create_params); | 293 return content::WebContents::Create(create_params); |
| 294 } | 294 } |
| 295 | 295 |
| 296 return contents; | 296 return contents; |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace views | 299 } // namespace views |
| OLD | NEW |