summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 22:20:14 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 22:20:14 +0000
commita4ad544b57c98407e6687abd77897c4cdbcdfb60 (patch)
tree1773fd2524fd31a379fe014315f49ca75e2aaf3d /chrome/browser
parent375bd73180b555a9e1e98ef63ed451d2cb3b5c46 (diff)
downloadchromium_src-a4ad544b57c98407e6687abd77897c4cdbcdfb60.zip
chromium_src-a4ad544b57c98407e6687abd77897c4cdbcdfb60.tar.gz
chromium_src-a4ad544b57c98407e6687abd77897c4cdbcdfb60.tar.bz2
Relanding this CL that was previously backed-out.
Fix the focus on post reload warning constrained window. The initial focus was not set to the right view. TBR=chase BUG=41926 TEST=Navigate to a page with a post. Reload the page. A constrained window with a warning that it is going to repost. The OK button should be focused. Pressing TAB should move the button to the next button. Pressing ESC should close the dialog. Review URL: http://codereview.chromium.org/3238004 Review URL: http://codereview.chromium.org/3228004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/views/constrained_window_win.cc6
-rw-r--r--chrome/browser/views/constrained_window_win.h1
2 files changed, 2 insertions, 5 deletions
diff --git a/chrome/browser/views/constrained_window_win.cc b/chrome/browser/views/constrained_window_win.cc
index 7874b12..4230606 100644
--- a/chrome/browser/views/constrained_window_win.cc
+++ b/chrome/browser/views/constrained_window_win.cc
@@ -563,7 +563,8 @@ views::NonClientFrameView* ConstrainedWindowWin::CreateFrameViewForWindow() {
}
void ConstrainedWindowWin::FocusConstrainedWindow() {
- focused_view_->RequestFocus();
+ if (GetDelegate() && GetDelegate()->GetInitiallyFocusedView())
+ GetDelegate()->GetInitiallyFocusedView()->RequestFocus();
}
void ConstrainedWindowWin::ShowConstrainedWindow() {
@@ -611,9 +612,6 @@ ConstrainedWindowWin::ConstrainedWindowWin(
set_focus_on_creation(false);
WindowWin::Init(owner_->GetNativeView(), gfx::Rect());
-
- focused_view_ = window_delegate->GetContentsView();
- DCHECK(focused_view_);
}
void ConstrainedWindowWin::ActivateConstrainedWindow() {
diff --git a/chrome/browser/views/constrained_window_win.h b/chrome/browser/views/constrained_window_win.h
index 5e925b3..9b17bf6 100644
--- a/chrome/browser/views/constrained_window_win.h
+++ b/chrome/browser/views/constrained_window_win.h
@@ -71,7 +71,6 @@ class ConstrainedWindowWin : public ConstrainedWindow,
// Current display rectangle (relative to owner_'s visible area).
gfx::Rect current_bounds_;
- views::View* focused_view_;
DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowWin);
};