| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/dock_info.h" | 5 #include "chrome/browser/dock_info.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <atlmisc.h> | 9 #include <atlmisc.h> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 !TopMostFinder::IsTopMostWindowAtPoint(finder.result_.window(), | 188 !TopMostFinder::IsTopMostWindowAtPoint(finder.result_.window(), |
| 189 finder.result_.hot_spot(), | 189 finder.result_.hot_spot(), |
| 190 ignore)) { | 190 ignore)) { |
| 191 finder.result_.set_type(DockInfo::NONE); | 191 finder.result_.set_type(DockInfo::NONE); |
| 192 } | 192 } |
| 193 return finder.result_; | 193 return finder.result_; |
| 194 } | 194 } |
| 195 | 195 |
| 196 protected: | 196 protected: |
| 197 virtual bool ShouldStopIterating(HWND hwnd) { | 197 virtual bool ShouldStopIterating(HWND hwnd) { |
| 198 BrowserView* window = BrowserView::GetBrowserViewForNativeView(hwnd); | 198 BrowserView* window = BrowserView::GetBrowserViewForNativeWindow(hwnd); |
| 199 CRect bounds; | 199 CRect bounds; |
| 200 if (!window || !::IsWindowVisible(hwnd) || | 200 if (!window || !::IsWindowVisible(hwnd) || |
| 201 !::GetWindowRect(hwnd, &bounds)) { | 201 !::GetWindowRect(hwnd, &bounds)) { |
| 202 return false; | 202 return false; |
| 203 } | 203 } |
| 204 | 204 |
| 205 // Check the three corners we allow docking to. We don't currently allow | 205 // Check the three corners we allow docking to. We don't currently allow |
| 206 // docking to top of window as it conflicts with docking to the tab strip. | 206 // docking to top of window as it conflicts with docking to the tab strip. |
| 207 if (CheckPoint(hwnd, bounds.left, (bounds.top + bounds.bottom) / 2, | 207 if (CheckPoint(hwnd, bounds.left, (bounds.top + bounds.bottom) / 2, |
| 208 DockInfo::LEFT_OF_WINDOW) || | 208 DockInfo::LEFT_OF_WINDOW) || |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { | 307 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { |
| 308 if (IsZoomed(window())) { | 308 if (IsZoomed(window())) { |
| 309 // We're docking relative to another window, we need to make sure the | 309 // We're docking relative to another window, we need to make sure the |
| 310 // window we're docking to isn't maximized. | 310 // window we're docking to isn't maximized. |
| 311 ShowWindow(window(), SW_RESTORE | SW_SHOWNA); | 311 ShowWindow(window(), SW_RESTORE | SW_SHOWNA); |
| 312 } | 312 } |
| 313 ::SetWindowPos(window(), HWND_TOP, bounds.x(), bounds.y(), bounds.width(), | 313 ::SetWindowPos(window(), HWND_TOP, bounds.x(), bounds.y(), bounds.width(), |
| 314 bounds.height(), SWP_NOACTIVATE | SWP_NOOWNERZORDER); | 314 bounds.height(), SWP_NOACTIVATE | SWP_NOOWNERZORDER); |
| 315 } | 315 } |
| OLD | NEW |