summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 00:10:00 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 00:10:00 +0000
commit4a507a6db2df46df4948bcab8705d75bf62f47bf (patch)
tree8b4def46fa1f1ffd87299159534fd588d8ae2ec5 /chrome/browser
parent653a834a712119f39879f6777c2673c0777c7e10 (diff)
downloadchromium_src-4a507a6db2df46df4948bcab8705d75bf62f47bf.zip
chromium_src-4a507a6db2df46df4948bcab8705d75bf62f47bf.tar.gz
chromium_src-4a507a6db2df46df4948bcab8705d75bf62f47bf.tar.bz2
Turn BrowserView::GetBrowserViewForNativeView() into GetBrowserViewForNativeWindow()
This simplifies things on linux where the native window is not the same type as the native view. Review URL: http://codereview.chromium.org/115830 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17043 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_focus_uitest.cc24
-rw-r--r--chrome/browser/dock_info_win.cc2
-rw-r--r--chrome/browser/views/browser_bubble_win.cc8
-rw-r--r--chrome/browser/views/frame/browser_view.cc3
-rw-r--r--chrome/browser/views/frame/browser_view.h2
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc3
6 files changed, 24 insertions, 18 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc
index a452e5f..712f955 100644
--- a/chrome/browser/browser_focus_uitest.cc
+++ b/chrome/browser/browser_focus_uitest.cc
@@ -105,7 +105,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_BrowsersRememberFocus) {
// The focus should be on the Tab contents.
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
ASSERT_TRUE(browser_view);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
@@ -145,7 +145,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_BrowsersRememberFocus) {
ui_test_utils::NavigateToURL(browser2, url);
HWND hwnd2 = reinterpret_cast<HWND>(browser2->window()->GetNativeHandle());
- BrowserView* browser_view2 = BrowserView::GetBrowserViewForNativeView(hwnd2);
+ BrowserView* browser_view2 =
+ BrowserView::GetBrowserViewForNativeWindow(hwnd2);
ASSERT_TRUE(browser_view2);
views::FocusManager* focus_manager2 =
views::FocusManager::GetFocusManager(hwnd2);
@@ -178,7 +179,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) {
ui_test_utils::NavigateToURL(browser(), url);
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
ASSERT_TRUE(browser_view);
views::FocusManager* focus_manager =
@@ -254,13 +255,14 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BackgroundBrowserDontStealFocus) {
// Make sure the first browser is still active.
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
ASSERT_TRUE(browser_view);
EXPECT_TRUE(browser_view->frame()->GetWindow()->IsActive());
// Close the 2nd browser to avoid a DCHECK().
HWND hwnd2 = reinterpret_cast<HWND>(browser2->window()->GetNativeHandle());
- BrowserView* browser_view2 = BrowserView::GetBrowserViewForNativeView(hwnd2);
+ BrowserView* browser_view2 =
+ BrowserView::GetBrowserViewForNativeWindow(hwnd2);
browser_view2->Close();
}
@@ -273,7 +275,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) {
ui_test_utils::NavigateToURL(browser(), url);
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
@@ -301,7 +303,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusTraversal) {
ui_test_utils::NavigateToURL(browser(), url);
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
@@ -391,7 +393,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusTraversalOnInterstitial) {
ui_test_utils::NavigateToURL(browser(), url);
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
@@ -486,7 +488,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, InterstitialFocus) {
ui_test_utils::NavigateToURL(browser(), url);
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
@@ -531,7 +533,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) {
ui_test_utils::NavigateToURL(browser(), url);
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
LocationBarView* location_bar = browser_view->GetLocationBarView();
@@ -602,7 +604,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) {
// types of tabs.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabInitialFocus) {
HWND hwnd = reinterpret_cast<HWND>(browser()->window()->GetNativeHandle());
- BrowserView* browser_view = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(hwnd);
ASSERT_TRUE(browser_view);
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(hwnd);
diff --git a/chrome/browser/dock_info_win.cc b/chrome/browser/dock_info_win.cc
index 72241a4..8997659 100644
--- a/chrome/browser/dock_info_win.cc
+++ b/chrome/browser/dock_info_win.cc
@@ -195,7 +195,7 @@ class DockToWindowFinder : public BaseWindowFinder {
protected:
virtual bool ShouldStopIterating(HWND hwnd) {
- BrowserView* window = BrowserView::GetBrowserViewForNativeView(hwnd);
+ BrowserView* window = BrowserView::GetBrowserViewForNativeWindow(hwnd);
CRect bounds;
if (!window || !::IsWindowVisible(hwnd) ||
!::GetWindowRect(hwnd, &bounds)) {
diff --git a/chrome/browser/views/browser_bubble_win.cc b/chrome/browser/views/browser_bubble_win.cc
index 47924ec..6cedf6a 100644
--- a/chrome/browser/views/browser_bubble_win.cc
+++ b/chrome/browser/views/browser_bubble_win.cc
@@ -7,9 +7,11 @@
#include "app/l10n_util_win.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "views/widget/widget_win.h"
+#include "views/window/window.h"
void BrowserBubble::InitPopup() {
gfx::NativeView native_view = frame_->GetNativeView();
+ gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow();
views::WidgetWin* pop = new views::WidgetWin();
pop->set_delete_on_destroy(false);
pop->set_window_style(WS_POPUP);
@@ -23,16 +25,16 @@ void BrowserBubble::InitPopup() {
Reposition();
BrowserView* browser_view =
- BrowserView::GetBrowserViewForNativeView(native_view);
+ BrowserView::GetBrowserViewForNativeWindow(native_window);
DCHECK(browser_view);
if (browser_view)
browser_view->AttachBrowserBubble(this);
}
void BrowserBubble::DestroyPopup() {
- gfx::NativeView native_view = frame_->GetNativeView();
+ gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow();
BrowserView* browser_view =
- BrowserView::GetBrowserViewForNativeView(native_view);
+ BrowserView::GetBrowserViewForNativeWindow(native_window);
if (browser_view)
browser_view->DetachBrowserBubble(this);
}
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 8dccabc..43ac628 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -305,7 +305,8 @@ BrowserView::~BrowserView() {
}
// static
-BrowserView* BrowserView::GetBrowserViewForNativeView(gfx::NativeView window) {
+BrowserView* BrowserView::GetBrowserViewForNativeWindow(
+ gfx::NativeWindow window) {
#if defined(OS_WIN)
if (IsWindow(window)) {
HANDLE data = GetProp(window, kBrowserViewKey);
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index 13f8591..47bf3ed 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -68,7 +68,7 @@ class BrowserView : public BrowserWindow,
// Returns a pointer to the BrowserView* interface implementation (an
// instance of this object, typically) for a given native window, or NULL if
// there is no such association.
- static BrowserView* GetBrowserViewForNativeView(gfx::NativeView window);
+ static BrowserView* GetBrowserViewForNativeWindow(gfx::NativeWindow window);
// Returns the show flag that should be used to show the frame containing
// this view.
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index 06ca3ad..fb60b78 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -653,7 +653,8 @@ TabStrip* DraggedTabController::GetTabStripForPoint(
dock_windows_.erase(dragged_view);
if (!local_window)
return NULL;
- BrowserView* browser = BrowserView::GetBrowserViewForNativeView(local_window);
+ BrowserView* browser =
+ BrowserView::GetBrowserViewForNativeWindow(local_window);
if (!browser)
return NULL;