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

Side by Side Diff: chrome/browser/ui/views/constrained_window_views.cc

Issue 10910034: Attempt 2 at: Fixes crash that occured because NativeViewHostAura::Detach was not (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: da fix Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.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 "chrome/browser/ui/views/constrained_window_views.h" 5 #include "chrome/browser/ui/views/constrained_window_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 void ConstrainedWindowViews::FocusConstrainedWindow() { 633 void ConstrainedWindowViews::FocusConstrainedWindow() {
634 ConstrainedWindowTabHelper* helper = 634 ConstrainedWindowTabHelper* helper =
635 tab_contents_->constrained_window_tab_helper(); 635 tab_contents_->constrained_window_tab_helper();
636 if ((!helper->delegate() || 636 if ((!helper->delegate() ||
637 helper->delegate()->ShouldFocusConstrainedWindow()) && 637 helper->delegate()->ShouldFocusConstrainedWindow()) &&
638 widget_delegate() && 638 widget_delegate() &&
639 widget_delegate()->GetInitiallyFocusedView()) { 639 widget_delegate()->GetInitiallyFocusedView()) {
640 widget_delegate()->GetInitiallyFocusedView()->RequestFocus(); 640 widget_delegate()->GetInitiallyFocusedView()->RequestFocus();
641 } 641 }
642 #if defined(USE_ASH) 642 #if defined(USE_ASH)
643 GetNativeView()->Focus(); 643 // We don't necessarily have a RootWindow yet.
644 if (GetNativeView()->GetRootWindow())
645 GetNativeView()->Focus();
644 #endif 646 #endif
645 } 647 }
646 648
647 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { 649 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() {
648 return Widget::GetNativeWindow(); 650 return Widget::GetNativeWindow();
649 } 651 }
650 652
651 //////////////////////////////////////////////////////////////////////////////// 653 ////////////////////////////////////////////////////////////////////////////////
652 // ConstrainedWindowViews, views::Widget overrides: 654 // ConstrainedWindowViews, views::Widget overrides:
653 655
(...skipping 26 matching lines...) Expand all
680 682
681 views::internal::NativeWidgetDelegate* 683 views::internal::NativeWidgetDelegate*
682 ConstrainedWindowViews::AsNativeWidgetDelegate() { 684 ConstrainedWindowViews::AsNativeWidgetDelegate() {
683 return this; 685 return this;
684 } 686 }
685 687
686 int ConstrainedWindowViews::GetNonClientComponent(const gfx::Point& point) { 688 int ConstrainedWindowViews::GetNonClientComponent(const gfx::Point& point) {
687 // Prevent a constrained window to be moved by the user. 689 // Prevent a constrained window to be moved by the user.
688 return HTNOWHERE; 690 return HTNOWHERE;
689 } 691 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698