summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 18:48:00 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 18:48:00 +0000
commit82166b65c8cdd7cb855c2d018be8c6c815324af6 (patch)
treef96034ed91ce66d6a3ba2afa07cdd4be1e55b264 /views/controls
parent7811b768ff61d58153a198a273cdb39581a77542 (diff)
downloadchromium_src-82166b65c8cdd7cb855c2d018be8c6c815324af6.zip
chromium_src-82166b65c8cdd7cb855c2d018be8c6c815324af6.tar.gz
chromium_src-82166b65c8cdd7cb855c2d018be8c6c815324af6.tar.bz2
This CL removes the last (major) Windows specific part out of the focus manager.
It was previously landed and reverted because it broke the reliability tests. http://codereview.chromium.org/125148 The breakage was caused by constrained windows not getting a hold of the FocusManager when in unparented tabs. The fix is to ensure unparented tab still have a way to access their FocusManager for proper closure. Files changed from the previous patch that need reviewing: native_tab_contents_container_win.cc tab_contents_view_win.h tab_contents_view_win.cc BUG=None TEST=Run all tests (unit, ui, interactive). Extensively test the focus in Chrome. Review URL: http://codereview.chromium.org/146093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/menu/chrome_menu.cc2
-rw-r--r--views/controls/native_control.cc3
-rw-r--r--views/controls/native_control_win.cc3
-rw-r--r--views/controls/tabbed_pane.cc2
-rw-r--r--views/controls/textfield/native_textfield_win.cc3
-rwxr-xr-xviews/controls/tree/tree_view.cc4
6 files changed, 6 insertions, 11 deletions
diff --git a/views/controls/menu/chrome_menu.cc b/views/controls/menu/chrome_menu.cc
index b05552f..f6e3950 100644
--- a/views/controls/menu/chrome_menu.cc
+++ b/views/controls/menu/chrome_menu.cc
@@ -685,7 +685,7 @@ class MenuHost : public WidgetWin {
const gfx::Rect& bounds,
View* contents_view,
bool do_capture) {
- WidgetWin::Init(parent, bounds, true);
+ WidgetWin::Init(parent, bounds);
SetContentsView(contents_view);
// We don't want to take focus away from the hosting window.
ShowWindow(SW_SHOWNA);
diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc
index 8e65689..fd247f9 100644
--- a/views/controls/native_control.cc
+++ b/views/controls/native_control.cc
@@ -367,8 +367,7 @@ LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, UINT message,
return 0;
} else if (message == WM_SETFOCUS) {
// Let the focus manager know that the focus changed.
- FocusManager* focus_manager =
- FocusManager::GetFocusManager(native_control->GetNativeControlHWND());
+ FocusManager* focus_manager = native_control->GetFocusManager();
if (focus_manager) {
focus_manager->SetFocusedView(native_control);
} else {
diff --git a/views/controls/native_control_win.cc b/views/controls/native_control_win.cc
index 1082adb..406b470 100644
--- a/views/controls/native_control_win.cc
+++ b/views/controls/native_control_win.cc
@@ -183,8 +183,7 @@ LRESULT NativeControlWin::NativeControlWndProc(HWND window,
return 0;
} else if (message == WM_SETFOCUS) {
// Let the focus manager know that the focus changed.
- FocusManager* focus_manager =
- FocusManager::GetFocusManager(native_control->native_view());
+ FocusManager* focus_manager = native_control->GetFocusManager();
if (focus_manager) {
focus_manager->SetFocusedView(native_control->focus_view());
} else {
diff --git a/views/controls/tabbed_pane.cc b/views/controls/tabbed_pane.cc
index a162131..b7c41bc 100644
--- a/views/controls/tabbed_pane.cc
+++ b/views/controls/tabbed_pane.cc
@@ -172,7 +172,7 @@ HWND TabbedPane::CreateNativeControl(HWND parent_container) {
// Create the view container which is a child of the TabControl.
content_window_ = new WidgetWin();
- content_window_->Init(tab_control_, gfx::Rect(), false);
+ content_window_->Init(tab_control_, gfx::Rect());
// Explicitly setting the WS_EX_LAYOUTRTL property for the HWND (see above
// for a thorough explanation regarding why we waited until |content_window_|
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index 1ccf651..cda6629 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -681,8 +681,7 @@ void NativeTextfieldWin::OnPaste() {
void NativeTextfieldWin::OnSetFocus(HWND hwnd) {
SetMsgHandled(FALSE); // We still want the default processing of the message.
- views::FocusManager* focus_manager =
- views::FocusManager::GetFocusManager(m_hWnd);
+ views::FocusManager* focus_manager = textfield_->GetFocusManager();
if (!focus_manager) {
NOTREACHED();
return;
diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc
index 95a7210..5a2fb42 100755
--- a/views/controls/tree/tree_view.cc
+++ b/views/controls/tree/tree_view.cc
@@ -471,13 +471,11 @@ bool TreeView::OnKeyDown(int virtual_key_code) {
} else if (virtual_key_code == VK_RETURN && !process_enter_) {
Widget* widget = GetWidget();
DCHECK(widget);
- FocusManager* fm = FocusManager::GetFocusManager(widget->GetNativeView());
- DCHECK(fm);
Accelerator accelerator(Accelerator(static_cast<int>(virtual_key_code),
win_util::IsShiftPressed(),
win_util::IsCtrlPressed(),
win_util::IsAltPressed()));
- fm->ProcessAccelerator(accelerator);
+ GetFocusManager()->ProcessAccelerator(accelerator);
return true;
}
return false;