Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Side by Side Diff: chrome/browser/views/frame/browser_view2.cc

Issue 7317: Change all ConvertPointTo* methods to use gfx::Point instead of CPoint.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/download_tab_view.cc ('k') | chrome/browser/views/location_bar_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 6
7 #include "chrome/browser/views/frame/browser_view2.h" 7 #include "chrome/browser/views/frame/browser_view2.h"
8 8
9 #include "chrome/app/chrome_dll_resource.h" 9 #include "chrome/app/chrome_dll_resource.h"
10 #include "chrome/app/theme/theme_resources.h" 10 #include "chrome/app/theme/theme_resources.h"
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 // Since the TabStrip only renders in some parts of the top of the window, 705 // Since the TabStrip only renders in some parts of the top of the window,
706 // the un-obscured area is considered to be part of the non-client caption 706 // the un-obscured area is considered to be part of the non-client caption
707 // area of the window. So we need to treat hit-tests in these regions as 707 // area of the window. So we need to treat hit-tests in these regions as
708 // hit-tests of the titlebar. 708 // hit-tests of the titlebar.
709 709
710 // Determine if the TabStrip exists and is capable of being clicked on. We 710 // Determine if the TabStrip exists and is capable of being clicked on. We
711 // might be a popup window without a TabStrip, or the TabStrip could be 711 // might be a popup window without a TabStrip, or the TabStrip could be
712 // animating. 712 // animating.
713 if (IsTabStripVisible() && tabstrip_->CanProcessInputEvents()) { 713 if (IsTabStripVisible() && tabstrip_->CanProcessInputEvents()) {
714 ChromeViews::Window* window = frame_->GetWindow(); 714 ChromeViews::Window* window = frame_->GetWindow();
715 CPoint point_in_view_coords(point.ToPOINT()); 715 gfx::Point point_in_view_coords(point);
716 View::ConvertPointToView(GetParent(), this, &point_in_view_coords); 716 View::ConvertPointToView(GetParent(), this, &point_in_view_coords);
717 717
718 // See if the mouse pointer is within the bounds of the TabStrip. 718 // See if the mouse pointer is within the bounds of the TabStrip.
719 CPoint point_in_tabstrip_coords(point.ToPOINT()); 719 gfx::Point point_in_tabstrip_coords(point);
720 View::ConvertPointToView(GetParent(), tabstrip_, &point_in_tabstrip_coords); 720 View::ConvertPointToView(GetParent(), tabstrip_, &point_in_tabstrip_coords);
721 if (tabstrip_->HitTest(point_in_tabstrip_coords)) { 721 if (tabstrip_->HitTest(point_in_tabstrip_coords.ToPOINT())) {
722 if (tabstrip_->PointIsWithinWindowCaption(point_in_tabstrip_coords)) 722 if (tabstrip_->PointIsWithinWindowCaption(point_in_tabstrip_coords))
723 return HTCAPTION; 723 return HTCAPTION;
724 return HTCLIENT; 724 return HTCLIENT;
725 } 725 }
726 726
727 // The top few pixels of the TabStrip are a drop-shadow - as we're pretty 727 // The top few pixels of the TabStrip are a drop-shadow - as we're pretty
728 // starved of dragable area, let's give it to window dragging (this also 728 // starved of dragable area, let's give it to window dragging (this also
729 // makes sense visually). 729 // makes sense visually).
730 if (!window->IsMaximized() && 730 if (!window->IsMaximized() &&
731 (point_in_view_coords.y < tabstrip_->y() + kTabShadowSize)) { 731 (point_in_view_coords.y() < tabstrip_->y() + kTabShadowSize)) {
732 // We return HTNOWHERE as this is a signal to our containing 732 // We return HTNOWHERE as this is a signal to our containing
733 // NonClientView that it should figure out what the correct hit-test 733 // NonClientView that it should figure out what the correct hit-test
734 // code is given the mouse position... 734 // code is given the mouse position...
735 return HTNOWHERE; 735 return HTNOWHERE;
736 } 736 }
737 } 737 }
738 738
739 // If the point's y coordinate is below the top of the toolbar and otherwise 739 // If the point's y coordinate is below the top of the toolbar and otherwise
740 // within the bounds of this view, the point is considered to be within the 740 // within the bounds of this view, the point is considered to be within the
741 // client area. 741 // client area.
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 // static 1190 // static
1191 void BrowserView2::InitClass() { 1191 void BrowserView2::InitClass() {
1192 static bool initialized = false; 1192 static bool initialized = false;
1193 if (!initialized) { 1193 if (!initialized) {
1194 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 1194 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
1195 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); 1195 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
1196 initialized = true; 1196 initialized = true;
1197 } 1197 }
1198 } 1198 }
1199 1199
OLDNEW
« no previous file with comments | « chrome/browser/views/download_tab_view.cc ('k') | chrome/browser/views/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698