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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 !TopMostFinder::IsTopMostWindowAtPoint(finder.result_.hwnd(), | 257 !TopMostFinder::IsTopMostWindowAtPoint(finder.result_.hwnd(), |
258 finder.result_.hot_spot(), | 258 finder.result_.hot_spot(), |
259 ignore)) { | 259 ignore)) { |
260 return DockInfo(); | 260 return DockInfo(); |
261 } | 261 } |
262 return finder.result_; | 262 return finder.result_; |
263 } | 263 } |
264 | 264 |
265 protected: | 265 protected: |
266 virtual bool ShouldStopIterating(HWND hwnd) { | 266 virtual bool ShouldStopIterating(HWND hwnd) { |
267 BrowserWindow* window = BrowserView::GetBrowserWindowForHWND(hwnd); | 267 BrowserView* window = BrowserView::GetBrowserViewForHWND(hwnd); |
268 CRect bounds; | 268 CRect bounds; |
269 if (!window || !::IsWindowVisible(hwnd) || | 269 if (!window || !::IsWindowVisible(hwnd) || |
270 !::GetWindowRect(hwnd, &bounds)) { | 270 !::GetWindowRect(hwnd, &bounds)) { |
271 return false; | 271 return false; |
272 } | 272 } |
273 | 273 |
274 // Check the three corners we allow docking to. We don't currently allow | 274 // Check the three corners we allow docking to. We don't currently allow |
275 // docking to top of window as it conflicts with docking to the tab strip. | 275 // docking to top of window as it conflicts with docking to the tab strip. |
276 if (CheckPoint(hwnd, bounds.left, (bounds.top + bounds.bottom) / 2, | 276 if (CheckPoint(hwnd, bounds.left, (bounds.top + bounds.bottom) / 2, |
277 DockInfo::LEFT_OF_WINDOW) || | 277 DockInfo::LEFT_OF_WINDOW) || |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 Type type) { | 497 Type type) { |
498 if (IsCloseToMonitorPoint(screen_loc, x, y, type, &in_enable_area_) && | 498 if (IsCloseToMonitorPoint(screen_loc, x, y, type, &in_enable_area_) && |
499 (type != MAXIMIZE || | 499 (type != MAXIMIZE || |
500 !IsMaximizedTabbedBrowserOnMonitor(monitor))) { | 500 !IsMaximizedTabbedBrowserOnMonitor(monitor))) { |
501 hot_spot_.SetPoint(x, y); | 501 hot_spot_.SetPoint(x, y); |
502 type_ = type; | 502 type_ = type; |
503 return true; | 503 return true; |
504 } | 504 } |
505 return false; | 505 return false; |
506 } | 506 } |
OLD | NEW |