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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 23478020: Makes sure that an input method doesn't reference to a destroyed object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worked on nits. Created 7 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 | content/browser/renderer_host/render_widget_host_view_win.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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 // If the tab was hidden and it's closed, host_->is_hidden would have been 2457 // If the tab was hidden and it's closed, host_->is_hidden would have been
2458 // reset to false in RenderWidgetHostImpl::RendererExited. 2458 // reset to false in RenderWidgetHostImpl::RendererExited.
2459 if (!window_->GetRootWindow() || host_->is_hidden()) { 2459 if (!window_->GetRootWindow() || host_->is_hidden()) {
2460 parent = ui::GetHiddenWindow(); 2460 parent = ui::GetHiddenWindow();
2461 } else { 2461 } else {
2462 parent = window_->GetRootWindow()->GetAcceleratedWidget(); 2462 parent = window_->GetRootWindow()->GetAcceleratedWidget();
2463 } 2463 }
2464 LPARAM lparam = reinterpret_cast<LPARAM>(this); 2464 LPARAM lparam = reinterpret_cast<LPARAM>(this);
2465 EnumChildWindows(parent, WindowDestroyingCallback, lparam); 2465 EnumChildWindows(parent, WindowDestroyingCallback, lparam);
2466 #endif 2466 #endif
2467
2468 // Make sure that the input method no longer references to this object before
2469 // this object is removed from the root window (i.e. this object loses access
2470 // to the input method).
2471 ui::InputMethod* input_method = GetInputMethod();
2472 if (input_method)
2473 input_method->DetachTextInputClient(this);
2467 } 2474 }
2468 2475
2469 void RenderWidgetHostViewAura::OnWindowDestroyed() { 2476 void RenderWidgetHostViewAura::OnWindowDestroyed() {
2470 host_->ViewDestroyed(); 2477 host_->ViewDestroyed();
2471 delete this; 2478 delete this;
2472 } 2479 }
2473 2480
2474 void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) { 2481 void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) {
2475 } 2482 }
2476 2483
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
3259 RenderWidgetHost* widget) { 3266 RenderWidgetHost* widget) {
3260 return new RenderWidgetHostViewAura(widget); 3267 return new RenderWidgetHostViewAura(widget);
3261 } 3268 }
3262 3269
3263 // static 3270 // static
3264 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3271 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3265 GetScreenInfoForWindow(results, NULL); 3272 GetScreenInfoForWindow(results, NULL);
3266 } 3273 }
3267 3274
3268 } // namespace content 3275 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698