Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: ui/views/controls/webview/webview.cc

Issue 584743004: Fix a crash which occurs while dragging tabs back to the window where they originated from. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted changes to render_widget_host_view_aura.cc Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/controls/webview/webview_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 if (!GetWidget() || !web_contents()) 296 if (!GetWidget() || !web_contents())
297 return; 297 return;
298 298
299 const gfx::NativeView view_to_attach = is_embedding_fullscreen_widget_ ? 299 const gfx::NativeView view_to_attach = is_embedding_fullscreen_widget_ ?
300 web_contents()->GetFullscreenRenderWidgetHostView()->GetNativeView() : 300 web_contents()->GetFullscreenRenderWidgetHostView()->GetNativeView() :
301 web_contents()->GetNativeView(); 301 web_contents()->GetNativeView();
302 OnBoundsChanged(bounds()); 302 OnBoundsChanged(bounds());
303 if (holder_->native_view() == view_to_attach) 303 if (holder_->native_view() == view_to_attach)
304 return; 304 return;
305 305
306 holder_->Attach(view_to_attach);
sky 2014/09/22 20:46:28 As order is important, document why.
ananta 2014/09/22 21:22:17 Done.
307
306 // Fullscreen widgets are not parented by a WebContentsView. Their visibility 308 // Fullscreen widgets are not parented by a WebContentsView. Their visibility
307 // is controlled by content i.e. (RenderWidgetHost) 309 // is controlled by content i.e. (RenderWidgetHost)
308 if (!is_embedding_fullscreen_widget_) 310 if (!is_embedding_fullscreen_widget_)
309 view_to_attach->Show(); 311 view_to_attach->Show();
310 312
311 holder_->Attach(view_to_attach);
312
313 // The view will not be focused automatically when it is attached, so we need 313 // The view will not be focused automatically when it is attached, so we need
314 // to pass on focus to it if the FocusManager thinks the view is focused. Note 314 // to pass on focus to it if the FocusManager thinks the view is focused. Note
315 // that not every Widget has a focus manager. 315 // that not every Widget has a focus manager.
316 FocusManager* const focus_manager = GetFocusManager(); 316 FocusManager* const focus_manager = GetFocusManager();
317 if (focus_manager && focus_manager->GetFocusedView() == this) 317 if (focus_manager && focus_manager->GetFocusedView() == this)
318 OnFocus(); 318 OnFocus();
319 319
320 #if defined(OS_WIN) 320 #if defined(OS_WIN)
321 if (!is_embedding_fullscreen_widget_) { 321 if (!is_embedding_fullscreen_widget_) {
322 web_contents()->SetParentNativeViewAccessible( 322 web_contents()->SetParentNativeViewAccessible(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if (!contents) { 377 if (!contents) {
378 content::WebContents::CreateParams create_params( 378 content::WebContents::CreateParams create_params(
379 browser_context, NULL); 379 browser_context, NULL);
380 return content::WebContents::Create(create_params); 380 return content::WebContents::Create(create_params);
381 } 381 }
382 382
383 return contents; 383 return contents;
384 } 384 }
385 385
386 } // namespace views 386 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/webview/webview_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698