summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 15:27:45 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 15:27:45 +0000
commitc39e715f96f482ebf4b2a00405bb3ccb5b8e8826 (patch)
tree7075abb007b554979d25fb7218283f048e1b792e /views/controls
parent211386d58b7fb341e2a895e5776e8380184d58c4 (diff)
downloadchromium_src-c39e715f96f482ebf4b2a00405bb3ccb5b8e8826.zip
chromium_src-c39e715f96f482ebf4b2a00405bb3ccb5b8e8826.tar.gz
chromium_src-c39e715f96f482ebf4b2a00405bb3ccb5b8e8826.tar.bz2
Revert :
Changed by: jcampan@chromium.org Changed at: Fri 19 Jun 2009 21:22:47 Branch: src Revision: 18889 Comments: Relanding focus manager refactoring with build fix, see:http://codereview.chromium.org/125148BUG=NoneTEST=NoneTBR=ben Review URL: http://codereview.chromium.org/141013 Because it creates hundreds of new reliability crashes. TBR:jcampan Review URL: http://codereview.chromium.org/140064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18904 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, 11 insertions, 6 deletions
diff --git a/views/controls/menu/chrome_menu.cc b/views/controls/menu/chrome_menu.cc
index f6e3950..b05552f 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);
+ WidgetWin::Init(parent, bounds, true);
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 5fd8349..2df961e 100644
--- a/views/controls/native_control.cc
+++ b/views/controls/native_control.cc
@@ -367,7 +367,8 @@ 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 = native_control->GetFocusManager();
+ FocusManager* focus_manager =
+ FocusManager::GetFocusManager(native_control->GetNativeControlHWND());
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 32c7261..b6111fd 100644
--- a/views/controls/native_control_win.cc
+++ b/views/controls/native_control_win.cc
@@ -196,7 +196,8 @@ LRESULT NativeControlWin::NativeControlWndProc(HWND window,
return 0;
} else if (message == WM_SETFOCUS) {
// Let the focus manager know that the focus changed.
- FocusManager* focus_manager = native_control->GetFocusManager();
+ FocusManager* focus_manager =
+ FocusManager::GetFocusManager(native_control->native_view());
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 b7c41bc..a162131 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());
+ content_window_->Init(tab_control_, gfx::Rect(), false);
// 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 cda6629..1ccf651 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -681,7 +681,8 @@ void NativeTextfieldWin::OnPaste() {
void NativeTextfieldWin::OnSetFocus(HWND hwnd) {
SetMsgHandled(FALSE); // We still want the default processing of the message.
- views::FocusManager* focus_manager = textfield_->GetFocusManager();
+ views::FocusManager* focus_manager =
+ views::FocusManager::GetFocusManager(m_hWnd);
if (!focus_manager) {
NOTREACHED();
return;
diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc
index 5a2fb42..95a7210 100755
--- a/views/controls/tree/tree_view.cc
+++ b/views/controls/tree/tree_view.cc
@@ -471,11 +471,13 @@ 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()));
- GetFocusManager()->ProcessAccelerator(accelerator);
+ fm->ProcessAccelerator(accelerator);
return true;
}
return false;