diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-22 15:27:45 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-22 15:27:45 +0000 |
commit | c39e715f96f482ebf4b2a00405bb3ccb5b8e8826 (patch) | |
tree | 7075abb007b554979d25fb7218283f048e1b792e /chrome/browser | |
parent | 211386d58b7fb341e2a895e5776e8380184d58c4 (diff) | |
download | chromium_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 'chrome/browser')
25 files changed, 96 insertions, 52 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index ed4237b..03e7824 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -1610,7 +1610,8 @@ void AutocompleteEditViewWin::OnPaste() { } void AutocompleteEditViewWin::OnSetFocus(HWND focus_wnd) { - views::FocusManager* focus_manager = parent_view_->GetFocusManager(); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(m_hWnd); if (focus_manager) { // Notify the FocusManager that the focused view is now the location bar // (our parent view). diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 8432fee..bcfd7a5 100755 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1729,7 +1729,7 @@ void AutomationProvider::GetFocusedViewID(int handle, int* view_id) { if (window_tracker_->ContainsHandle(handle)) { HWND hwnd = window_tracker_->GetResource(handle); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); DCHECK(focus_manager); views::View* focused_view = focus_manager->GetFocusedView(); if (focused_view) diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 8aebfcf..3681c1b 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BrowsersRememberFocus) { BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); ASSERT_TRUE(browser_view); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); ASSERT_TRUE(focus_manager); EXPECT_EQ(browser_view->GetTabContentsContainerView(), @@ -149,7 +149,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BrowsersRememberFocus) { BrowserView::GetBrowserViewForNativeWindow(hwnd2); ASSERT_TRUE(browser_view2); views::FocusManager* focus_manager2 = - views::FocusManager::GetFocusManagerForNativeView(hwnd2); + views::FocusManager::GetFocusManager(hwnd2); ASSERT_TRUE(focus_manager2); EXPECT_EQ(browser_view2->GetTabContentsContainerView(), focus_manager2->GetFocusedView()); @@ -183,13 +183,13 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) { ASSERT_TRUE(browser_view); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); ASSERT_TRUE(focus_manager); // Create several tabs. for (int i = 0; i < 4; ++i) { - browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, true, -1, - false, NULL); + browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, true, -1, false, + NULL); } // Alternate focus for the tab. @@ -283,7 +283,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) { HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle()); BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); // Click on the location bar. LocationBarView* location_bar = browser_view->GetLocationBarView(); @@ -311,7 +311,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusTraversal) { HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle()); BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); // Click on the location bar. LocationBarView* location_bar = browser_view->GetLocationBarView(); @@ -401,7 +401,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusTraversalOnInterstitial) { HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle()); BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); // Focus should be on the page. EXPECT_EQ(browser_view->GetTabContentsContainerView(), @@ -496,7 +496,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, InterstitialFocus) { HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle()); BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); // Page should have focus. EXPECT_EQ(browser_view->GetTabContentsContainerView(), @@ -541,7 +541,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle()); BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); LocationBarView* location_bar = browser_view->GetLocationBarView(); // Press Ctrl+F, which will make the Find box open and request focus. @@ -613,7 +613,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabInitialFocus) { BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd); ASSERT_TRUE(browser_view); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(hwnd); + views::FocusManager::GetFocusManager(hwnd); ASSERT_TRUE(focus_manager); // Open the history tab, focus should be on the tab contents. diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index d7e4836..7da0be0 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -53,12 +53,11 @@ bool ExternalTabContainer::Init(Profile* profile, } set_window_style(WS_POPUP); - views::WidgetWin::Init(NULL, bounds); + views::WidgetWin::Init(NULL, bounds, true); if (!IsWindow()) { NOTREACHED(); return false; } - // TODO(jcampan): limit focus traversal to contents. // We don't ever remove the prop because the lifetime of this object // is the same as the lifetime of the window diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc index 6f1d4a5..136350c 100644 --- a/chrome/browser/first_run_win.cc +++ b/chrome/browser/first_run_win.cc @@ -684,7 +684,7 @@ class TryChromeDialog : public views::ButtonListener, popup->set_delete_on_destroy(true); popup->set_window_style(WS_POPUP | WS_CLIPCHILDREN); popup->set_window_ex_style(WS_EX_TOOLWINDOW); - popup->Init(NULL, pos); + popup->Init(NULL, pos, true); views::RootView* root_view = popup->GetRootView(); // The window color is a tiny bit off-white. diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 5a75f50..e5091d6 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -406,7 +406,7 @@ void RenderWidgetHostViewWin::Focus() { void RenderWidgetHostViewWin::Blur() { views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(m_hWnd); + views::FocusManager::GetFocusManager(GetParent()); // We don't have a FocusManager if we are hidden. if (focus_manager && render_widget_host_->CanBlur()) focus_manager->ClearFocus(); diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_win.cc b/chrome/browser/views/autocomplete/autocomplete_popup_win.cc index accdbd5..02d3118 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_win.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_win.cc @@ -28,9 +28,7 @@ void AutocompletePopupWin::Init(AutocompleteEditViewWin* edit_view, views::View* contents) { // Create the popup WidgetWin::Init(edit_view->parent_view()->GetWidget()->GetNativeView(), - contents_->GetPopupBounds()); - // The contents is owned by the AutocompleteEditViewWin. - contents_->SetParentOwned(false); + contents_->GetPopupBounds(), false); // The contents is owned by the LocationBarView. contents_->SetParentOwned(false); SetContentsView(contents_); diff --git a/chrome/browser/views/blocked_popup_container_view_win.cc b/chrome/browser/views/blocked_popup_container_view_win.cc index 29240de..8e2837e 100644 --- a/chrome/browser/views/blocked_popup_container_view_win.cc +++ b/chrome/browser/views/blocked_popup_container_view_win.cc @@ -398,7 +398,7 @@ BlockedPopupContainerViewWin::BlockedPopupContainerViewWin( set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); WidgetWin::Init(GetModel()->GetConstrainingContents(NULL)->GetNativeView(), - gfx::Rect()); + gfx::Rect(), false); SetContentsView(container_view_); SetPosition(); } diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc index b81d0ab..9a2a8f6 100644 --- a/chrome/browser/views/bookmark_bubble_view.cc +++ b/chrome/browser/views/bookmark_bubble_view.cc @@ -182,7 +182,9 @@ void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous, void BookmarkBubbleView::BubbleShown() { DCHECK(GetWidget()); - GetFocusManager()->RegisterAccelerator( + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetWidget()->GetNativeView()); + focus_manager->RegisterAccelerator( views::Accelerator(VK_RETURN, false, false, false), this); title_tf_->RequestFocus(); diff --git a/chrome/browser/views/browser_bubble_win.cc b/chrome/browser/views/browser_bubble_win.cc index e72545b..7b47fe9 100644 --- a/chrome/browser/views/browser_bubble_win.cc +++ b/chrome/browser/views/browser_bubble_win.cc @@ -24,7 +24,9 @@ void BrowserBubble::InitPopup() { #endif // A focus manager is necessary if you want to be able to handle various // mouse events properly. - pop->Init(frame_native_view_, bounds_); + pop->Init(frame_native_view_, + bounds_, + true); // Give the widget a focus manager. pop->SetContentsView(view_); popup_.reset(pop); Reposition(); diff --git a/chrome/browser/views/constrained_window_win.cc b/chrome/browser/views/constrained_window_win.cc index 03759a3..f641f6f 100644 --- a/chrome/browser/views/constrained_window_win.cc +++ b/chrome/browser/views/constrained_window_win.cc @@ -638,13 +638,48 @@ ConstrainedWindowWin::ConstrainedWindowWin( void ConstrainedWindowWin::ActivateConstrainedWindow() { // Other pop-ups are simply moved to the front of the z-order. SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); + + // Store the focus of our parent focus manager so we can restore it when we + // close. + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetNativeView()); + DCHECK(focus_manager); + focus_manager = focus_manager->GetParentFocusManager(); + if (focus_manager) { + // We could not have a parent focus manager if the ConstrainedWindow is + // displayed in a tab that is not currently selected. + // TODO(jcampan): we should store the ConstrainedWindow active events in + // that case and replay them when the TabContents becomes selected. + focus_manager->StoreFocusedView(); + + // Give our window the focus so we get keyboard messages. + ::SetFocus(GetNativeView()); + } } //////////////////////////////////////////////////////////////////////////////// // ConstrainedWindowWin, views::WidgetWin overrides: void ConstrainedWindowWin::OnDestroy() { - // TODO(jcampan): figure out focus restoration + // We do this here, rather than |Close|, since the window may be destroyed in + // a way other than by some other component calling Close, e.g. by the native + // window hierarchy closing. We are guaranteed to receive a WM_DESTROY + // message regardless of how the window is closed. + // Note that when we get this message, the focus manager of the + // ConstrainedWindow has already been destroyed (by the processing of + // WM_DESTROY in FocusManager). So the FocusManager we retrieve here is the + // parent one (the one from the top window). + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetNativeView()); + if (focus_manager) { + // We may not have a focus manager if: + // - we are hidden when closed (the TabContent would be detached). + // - the tab has been closed and we are closed as a result. + // TODO(jcampan): when hidden, we should modify the stored focus of the tab + // so when it becomes visible again we retrieve the focus appropriately. + if (!focus_restoration_disabled_) + focus_manager->RestoreFocusedView(); + } // Make sure we call super so that it can do its cleanup. WindowWin::OnDestroy(); diff --git a/chrome/browser/views/download_started_animation_win.cc b/chrome/browser/views/download_started_animation_win.cc index ec71683..4de387e 100644 --- a/chrome/browser/views/download_started_animation_win.cc +++ b/chrome/browser/views/download_started_animation_win.cc @@ -106,7 +106,7 @@ DownloadStartedAnimationWin::DownloadStartedAnimationWin( popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT); popup_->SetOpacity(0x00); - popup_->Init(tab_contents_->GetNativeView(), rc); + popup_->Init(tab_contents_->GetNativeView(), rc, false); popup_->SetContentsView(this); Reposition(); popup_->Show(); diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index 4272ef7..51e1b20 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -95,13 +95,12 @@ FindBarWin::FindBarWin(BrowserView* browser_view) // Initialize the host. host_.reset(new Host(this)); - host_->Init(browser_view->GetWidget()->GetNativeView(), gfx::Rect()); + host_->Init(browser_view->GetWidget()->GetNativeView(), gfx::Rect(), false); host_->SetContentsView(view_); // Start listening to focus changes, so we can register and unregister our // own handler for Escape. - focus_manager_ = - views::FocusManager::GetFocusManagerForNativeView(host_->GetNativeView()); + focus_manager_ = views::FocusManager::GetFocusManager(host_->GetNativeView()); focus_manager_->AddFocusChangeListener(this); // Stores the currently focused view, and tracks focus changes so that we can diff --git a/chrome/browser/views/find_bar_win_browsertest.cc b/chrome/browser/views/find_bar_win_browsertest.cc index cf55acf..67b05ad 100644 --- a/chrome/browser/views/find_bar_win_browsertest.cc +++ b/chrome/browser/views/find_bar_win_browsertest.cc @@ -557,9 +557,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { GURL url = server->TestServerPageW(kSimplePage); ui_test_utils::NavigateToURL(browser(), url); - gfx::NativeView browser_view = browser()->window()->GetNativeHandle(); - views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(browser_view); + views::FocusManager* focus_manager = views::FocusManager::GetFocusManager( + browser()->window()->GetNativeHandle()); // See where Escape is registered. views::Accelerator escape(VK_ESCAPE, false, false, false); diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc index b79c665..ba8edb2 100644 --- a/chrome/browser/views/first_run_bubble.cc +++ b/chrome/browser/views/first_run_bubble.cc @@ -343,7 +343,9 @@ void FirstRunBubble::InfoBubbleClosing(InfoBubble* info_bubble, if (!IsWindowEnabled(GetParent())) ::EnableWindow(GetParent(), true); enable_window_method_factory_.RevokeAll(); - GetFocusManager()->RemoveFocusChangeListener(view_); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetNativeView()); + focus_manager->RemoveFocusChangeListener(view_); } // static @@ -360,7 +362,9 @@ FirstRunBubble* FirstRunBubble::Show(Profile* profile, views::Window* parent, window->set_view(view); window->Init(parent, position_relative_to, view); window->ShowWindow(SW_SHOW); - window->GetFocusManager()->AddFocusChangeListener(view); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(window->GetNativeView()); + focus_manager->AddFocusChangeListener(view); view->BubbleShown(); return window; } diff --git a/chrome/browser/views/fullscreen_exit_bubble.cc b/chrome/browser/views/fullscreen_exit_bubble.cc index 907a791..854c3dd 100644 --- a/chrome/browser/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/views/fullscreen_exit_bubble.cc @@ -144,7 +144,7 @@ FullscreenExitBubble::FullscreenExitBubble( popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | l10n_util::GetExtendedTooltipStyles()); popup_->SetOpacity(static_cast<unsigned char>(0xff * kOpacity)); - popup_->Init(frame->GetNativeView(), GetPopupRect(false)); + popup_->Init(frame->GetNativeView(), GetPopupRect(false), false); popup_->SetContentsView(view_); popup_->Show(); // This does not activate the popup. diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index 031caaf..908aa54 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -133,7 +133,7 @@ void InfoBubble::Init(views::Window* parent, content_view_->CalculateWindowBoundsAndAjust(position_relative_to); #if defined(OS_WIN) - WidgetWin::Init(parent->GetNativeWindow(), bounds); + WidgetWin::Init(parent->GetNativeWindow(), bounds, true); #else WidgetGtk::Init(GTK_WIDGET(parent->GetNativeWindow()), bounds, true); #endif @@ -155,9 +155,11 @@ void InfoBubble::Init(views::Window* parent, #if defined(OS_WIN) // Register the Escape accelerator for closing. - GetFocusManager()->RegisterAccelerator(views::Accelerator(VK_ESCAPE, false, - false, false), - this); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetNativeView()); + focus_manager->RegisterAccelerator(views::Accelerator(VK_ESCAPE, false, + false, false), + this); // Set initial alpha value of the layered window. SetLayeredWindowAttributes(GetNativeView(), RGB(0xFF, 0xFF, 0xFF), diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index 3e19bf7..12fe42e 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -207,8 +207,9 @@ void InfoBar::InfoBarAdded() { // focus so that we can restore focus when we're removed. views::Widget* widget = GetWidget(); if (widget) { - focus_tracker_.reset(new views::ExternalFocusTracker(this, - GetFocusManager())); + focus_tracker_.reset( + new views::ExternalFocusTracker(this, + views::FocusManager::GetFocusManager(widget->GetNativeView()))); } #endif } diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc index 12868f6..ade3be7 100644 --- a/chrome/browser/views/shelf_item_dialog.cc +++ b/chrome/browser/views/shelf_item_dialog.cc @@ -476,7 +476,8 @@ bool ShelfItemDialog::AcceleratorPressed( if (accelerator.GetKeyCode() == VK_ESCAPE) { window()->Close(); } else if (accelerator.GetKeyCode() == VK_RETURN) { - views::FocusManager* fm = GetFocusManager(); + views::FocusManager* fm = views::FocusManager::GetFocusManager( + GetWidget()->GetNativeView()); if (fm->GetFocusedView() == url_table_) { // Return on table behaves like a double click. OnDoubleClick(); diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc index ecaba94..933c6e5 100644 --- a/chrome/browser/views/status_bubble_views.cc +++ b/chrome/browser/views/status_bubble_views.cc @@ -485,7 +485,7 @@ void StatusBubbleViews::Init() { WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles()); popup->SetOpacity(0x00); - popup->Init(frame_->GetNativeView(), gfx::Rect()); + popup->Init(frame_->GetNativeView(), gfx::Rect(), false); popup->SetContentsView(view_); Reposition(); popup->Show(); diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc index 2080cff..1b7fa80 100755 --- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc @@ -73,7 +73,7 @@ void TabContentsViewWin::CreateView() { // Since we create these windows parented to the desktop window initially, we // don't want to create them initially visible. set_window_style(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - WidgetWin::Init(GetDesktopWindow(), gfx::Rect()); + WidgetWin::Init(GetDesktopWindow(), gfx::Rect(), false); // Remove the root view drop target so we can register our own. RevokeDragDrop(GetNativeView()); @@ -233,7 +233,7 @@ void TabContentsViewWin::SizeContents(const gfx::Size& size) { void TabContentsViewWin::Focus() { views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(GetNativeView()); + views::FocusManager::GetFocusManager(GetNativeView()); if (tab_contents()->interstitial_page()) { tab_contents()->interstitial_page()->Focus(); @@ -269,7 +269,7 @@ void TabContentsViewWin::StoreFocus() { view_storage->RemoveView(last_focused_view_storage_id_); views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(GetNativeView()); + views::FocusManager::GetFocusManager(GetNativeView()); if (focus_manager) { // |focus_manager| can be NULL if the tab has been detached but still // exists. @@ -301,7 +301,7 @@ void TabContentsViewWin::RestoreFocus() { SetInitialFocus(); } else { views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(GetNativeView()); + views::FocusManager::GetFocusManager(GetNativeView()); // If you hit this DCHECK, please report it to Jay (jcampan). DCHECK(focus_manager != NULL) << "No focus manager when restoring focus."; @@ -333,7 +333,7 @@ void TabContentsViewWin::GotFocus() { void TabContentsViewWin::TakeFocus(bool reverse) { if (!tab_contents()->delegate()->TakeFocus(reverse)) { views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(GetNativeView()); + views::FocusManager::GetFocusManager(GetNativeView()); // We may not have a focus manager if the tab has been switched before this // message arrived. @@ -357,7 +357,7 @@ void TabContentsViewWin::HandleKeyboardEvent( // a keyboard shortcut that we have to process. if (event.type == WebInputEvent::RawKeyDown) { views::FocusManager* focus_manager = - views::FocusManager::GetFocusManagerForNativeView(GetNativeView()); + views::FocusManager::GetFocusManager(GetNativeView()); // We may not have a focus_manager at this point (if the tab has been // switched by the time this message returned). if (focus_manager) { diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index adf7903..b4fea1d 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -198,7 +198,7 @@ class DraggedTabController::DockDisplayer : public AnimationDelegate { popup->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TOPMOST); popup->SetOpacity(0x00); - popup->Init(NULL, info.GetPopupRect()); + popup->Init(NULL, info.GetPopupRect(), false); popup->SetContentsView(new DockView(info.type())); if (info.in_enable_area()) animation_.Reset(1); diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc index b77ace5..f3101d9 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/views/tabs/dragged_tab_view.cc @@ -48,7 +48,7 @@ DraggedTabView::DraggedTabView(TabContents* datasource, container_->set_window_ex_style( WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_TOOLWINDOW); container_->set_can_update_layered_window(false); - container_->Init(NULL, gfx::Rect(0, 0, 0, 0)); + container_->Init(NULL, gfx::Rect(0, 0, 0, 0), false); container_->SetContentsView(this); BOOL drag; diff --git a/chrome/browser/views/tabs/native_view_photobooth_win.cc b/chrome/browser/views/tabs/native_view_photobooth_win.cc index 6f78ea9..430e009 100644 --- a/chrome/browser/views/tabs/native_view_photobooth_win.cc +++ b/chrome/browser/views/tabs/native_view_photobooth_win.cc @@ -155,7 +155,7 @@ void NativeViewPhotoboothWin::CreateCaptureWindow(HWND initial_hwnd) { // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar // button. capture_window_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW); - capture_window_->Init(NULL, capture_bounds); + capture_window_->Init(NULL, capture_bounds, false); // If the capture window isn't visible, blitting from the TabContents' // HWND's DC to the capture bitmap produces blankness. capture_window_->Show(); diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index b5f0aae..d669be3 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -1382,7 +1382,8 @@ TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) arrow_window->Init( NULL, - gfx::Rect(0, 0, drop_indicator_width, drop_indicator_height)); + gfx::Rect(0, 0, drop_indicator_width, drop_indicator_height), + true); arrow_window->SetContentsView(arrow_view); #else NOTIMPLEMENTED(); |