diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 19:29:06 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 19:29:06 +0000 |
commit | ed8b1b805203b6ccdb5517d0c30cc689dde65e98 (patch) | |
tree | 88b8d0c2e552f291fbb01e8aa660806597e9d3fc /chrome/browser/views/tabs | |
parent | 71994cd0877f3528079b1154d46d90801e515292 (diff) | |
download | chromium_src-ed8b1b805203b6ccdb5517d0c30cc689dde65e98.zip chromium_src-ed8b1b805203b6ccdb5517d0c30cc689dde65e98.tar.gz chromium_src-ed8b1b805203b6ccdb5517d0c30cc689dde65e98.tar.bz2 |
Make Widget return a gfx::NativeView instead of a HWND.
Review URL: http://codereview.chromium.org/43124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 16 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/tabs/hwnd_photobooth.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 7 |
5 files changed, 19 insertions, 18 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index fe5cc51..8f0536e 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -170,7 +170,7 @@ class DraggedTabController::DockDisplayer : public AnimationDelegate { animation_.Show(); popup_->SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOMOVE | SWP_SHOWWINDOW); - popup_hwnd_ = popup_->GetHWND(); + popup_hwnd_ = popup_->GetNativeView(); } ~DockDisplayer() { @@ -635,7 +635,7 @@ DockInfo DraggedTabController::GetDockInfoAtPoint( return dock_info_; } - HWND dragged_hwnd = view_->GetWidget()->GetHWND(); + HWND dragged_hwnd = view_->GetWidget()->GetNativeView(); dock_windows_.insert(dragged_hwnd); DockInfo info = DockInfo::GetDockInfoAtPoint(screen_point, dock_windows_); dock_windows_.erase(dragged_hwnd); @@ -644,7 +644,7 @@ DockInfo DraggedTabController::GetDockInfoAtPoint( TabStrip* DraggedTabController::GetTabStripForPoint( const gfx::Point& screen_point) { - HWND dragged_hwnd = view_->GetWidget()->GetHWND(); + HWND dragged_hwnd = view_->GetWidget()->GetNativeView(); dock_windows_.insert(dragged_hwnd); HWND local_window = DockInfo::GetLocalProcessWindowAtPoint(screen_point, dock_windows_); @@ -969,7 +969,7 @@ void DraggedTabController::RevertDrag() { // it has been hidden. if (restore_frame) { if (!restore_bounds_.IsEmpty()) { - HWND frame_hwnd = source_tabstrip_->GetWidget()->GetHWND(); + HWND frame_hwnd = source_tabstrip_->GetWidget()->GetNativeView(); MoveWindow(frame_hwnd, restore_bounds_.x(), restore_bounds_.y(), restore_bounds_.width(), restore_bounds_.height(), TRUE); } @@ -1037,7 +1037,7 @@ bool DraggedTabController::CompleteDrag() { } // Compel the model to construct a new window for the detached TabContents. CRect browser_rect; - GetWindowRect(source_tabstrip_->GetWidget()->GetHWND(), &browser_rect); + GetWindowRect(source_tabstrip_->GetWidget()->GetNativeView(), &browser_rect); gfx::Rect window_bounds( GetWindowCreatePoint(), gfx::Size(browser_rect.Width(), browser_rect.Height())); @@ -1086,7 +1086,7 @@ int DraggedTabController::NormalizeIndexToAttachedTabStrip(int index) const { void DraggedTabController::HideFrame() { // We don't actually hide the window, rather we just move it way off-screen. // If we actually hide it, we stop receiving drag events. - HWND frame_hwnd = source_tabstrip_->GetWidget()->GetHWND(); + HWND frame_hwnd = source_tabstrip_->GetWidget()->GetNativeView(); RECT wr; GetWindowRect(frame_hwnd, &wr); MoveWindow(frame_hwnd, 0xFFFF, 0xFFFF, wr.right - wr.left, @@ -1154,7 +1154,7 @@ void DraggedTabController::BringWindowUnderMouseToFront() { // If we're going to dock to another window, bring it to the front. HWND hwnd = dock_info_.hwnd(); if (!hwnd) { - HWND dragged_hwnd = view_->GetWidget()->GetHWND(); + HWND dragged_hwnd = view_->GetWidget()->GetNativeView(); dock_windows_.insert(dragged_hwnd); hwnd = DockInfo::GetLocalProcessWindowAtPoint(GetCursorScreenPoint(), dock_windows_); @@ -1167,7 +1167,7 @@ void DraggedTabController::BringWindowUnderMouseToFront() { // The previous call made the window appear on top of the dragged window, // move the dragged window to the front. - SetWindowPos(view_->GetWidget()->GetHWND(), HWND_TOP, 0, 0, 0, 0, + SetWindowPos(view_->GetWidget()->GetNativeView(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } } diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc index aae0052..eb3f15a 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/views/tabs/dragged_tab_view.cc @@ -107,7 +107,7 @@ void DraggedTabView::AnimateToBounds(const gfx::Rect& bounds, animation_callback_.reset(callback); RECT wr; - GetWindowRect(GetWidget()->GetHWND(), &wr); + GetWindowRect(GetWidget()->GetNativeView(), &wr); animation_start_bounds_ = wr; animation_end_bounds_ = bounds; @@ -229,7 +229,7 @@ void DraggedTabView::PaintDetachedView(ChromeCanvas* canvas) { void DraggedTabView::ResizeContainer() { gfx::Size ps = GetPreferredSize(); - SetWindowPos(container_->GetHWND(), HWND_TOPMOST, 0, 0, + SetWindowPos(container_->GetNativeView(), HWND_TOPMOST, 0, 0, ScaleValue(ps.width()), ScaleValue(ps.height()), SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } diff --git a/chrome/browser/views/tabs/hwnd_photobooth.cc b/chrome/browser/views/tabs/hwnd_photobooth.cc index 88fb24c..01e70a7 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.cc +++ b/chrome/browser/views/tabs/hwnd_photobooth.cc @@ -56,7 +56,7 @@ HWNDPhotobooth::~HWNDPhotobooth() { void HWNDPhotobooth::ReplaceHWND(HWND new_hwnd) { if (IsWindow(current_hwnd_) && - GetParent(current_hwnd_) == capture_window_->GetHWND()) { + GetParent(current_hwnd_) == capture_window_->GetNativeView()) { // We need to hide the window too, so it doesn't show up in the TaskBar or // be parented to the desktop. ShowWindow(current_hwnd_, SW_HIDE); @@ -66,7 +66,7 @@ void HWNDPhotobooth::ReplaceHWND(HWND new_hwnd) { if (IsWindow(new_hwnd)) { // Insert the TabContents into the capture window. - SetParent(current_hwnd_, capture_window_->GetHWND()); + SetParent(current_hwnd_, capture_window_->GetNativeView()); // Show the window (it may not be visible). This is the only safe way of // doing this. ShowWindow does not work. @@ -83,7 +83,7 @@ void HWNDPhotobooth::PaintScreenshotIntoCanvas( // Our contained window may have been re-parented. Make sure it belongs to // us until someone calls ReplaceHWND(NULL). if (IsWindow(current_hwnd_) && - GetParent(current_hwnd_) != capture_window_->GetHWND()) { + GetParent(current_hwnd_) != capture_window_->GetNativeView()) { ReplaceHWND(current_hwnd_); } @@ -153,7 +153,7 @@ void HWNDPhotobooth::CreateCaptureWindow(HWND initial_hwnd) { // HWND's DC to the capture bitmap produces blankness. capture_window_->Show(); SetLayeredWindowAttributes( - capture_window_->GetHWND(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); + capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); ReplaceHWND(initial_hwnd); } diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index d0143d9..5f1a911 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -50,7 +50,7 @@ class Tab::ContextMenuController : public views::MenuDelegate { } void RunMenuAt(int x, int y) { - menu_->RunMenuAt(tab_->GetWidget()->GetHWND(), gfx::Rect(x, y, 0, 0), + menu_->RunMenuAt(tab_->GetWidget()->GetNativeView(), gfx::Rect(x, y, 0, 0), views::MenuItemView::TOPLEFT, true); if (tab_) tab_->ContextMenuClosed(); diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index c256a82..7b26c78 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -337,13 +337,14 @@ class RemoveTabAnimation : public TabStrip::TabAnimation { GetCursorPos(&pt); views::Widget* widget = tabstrip_->GetWidget(); RECT wr; - GetWindowRect(widget->GetHWND(), &wr); + GetWindowRect(widget->GetNativeView(), &wr); pt.x -= wr.left; pt.y -= wr.top; // Return to message loop - otherwise we may disrupt some operation that's // in progress. - PostMessage(widget->GetHWND(), WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y)); + PostMessage(widget->GetNativeView(), WM_MOUSEMOVE, 0, + MAKELPARAM(pt.x, pt.y)); } int index_; @@ -818,7 +819,7 @@ void TabStrip::TabInsertedAt(TabContents* contents, // Don't animate the first tab, it looks weird, and don't animate anything // if the containing window isn't visible yet. if (GetTabCount() > 1 && GetWidget() && - IsWindowVisible(GetWidget()->GetHWND())) { + IsWindowVisible(GetWidget()->GetNativeView())) { StartInsertTabAnimation(index); } else { Layout(); |