summaryrefslogtreecommitdiffstats
path: root/chrome/views/view.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 18:40:10 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 18:40:10 +0000
commit2fb6d466842f445078962a2f5aa4fa7af49d2313 (patch)
tree5c0a8fa678d4a36bb89a61f773f32b6ea5c7d8f0 /chrome/views/view.cc
parent830e2069f5c67d74cd4f2720438ea6a9609994c3 (diff)
downloadchromium_src-2fb6d466842f445078962a2f5aa4fa7af49d2313.zip
chromium_src-2fb6d466842f445078962a2f5aa4fa7af49d2313.tar.gz
chromium_src-2fb6d466842f445078962a2f5aa4fa7af49d2313.tar.bz2
Make system menus show up at the right place for all frames, whether they're triggered by clicking the window icon or hitting alt-space. Make clicking the icon for windows without a non-client view (e.g. the Bookmark Manager on Aero Glass) bring up the system menu.
Clean up more dead code, verbose code, or unnecessary statics/members. TEST=Right-click titlebars, hit alt-space, and left-click window icons (where present), for: * Main window * Dialogs, e.g. the bookmark manager * Popups * App windows When right-clicking, a system menu should appear at the cursor. For the other cases, a system menu should appear at the system native location (roughly just below the titlebar). Review URL: http://codereview.chromium.org/20225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/view.cc')
-rw-r--r--chrome/views/view.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/views/view.cc b/chrome/views/view.cc
index 59e5b73..8d1926f 100644
--- a/chrome/views/view.cc
+++ b/chrome/views/view.cc
@@ -1268,13 +1268,12 @@ void View::ConvertPointToView(const View* src,
}
// static
-void View::ConvertPointToWidget(View* src, gfx::Point* p) {
+void View::ConvertPointToWidget(const View* src, gfx::Point* p) {
DCHECK(src);
DCHECK(p);
- View *v;
gfx::Point offset;
- for (v = src; v; v = v->GetParent()) {
+ for (const View* v = src; v; v = v->GetParent()) {
offset.set_x(offset.x() + v->GetX(APPLY_MIRRORING_TRANSFORMATION));
offset.set_y(offset.y() + v->y());
}
@@ -1282,14 +1281,14 @@ void View::ConvertPointToWidget(View* src, gfx::Point* p) {
}
// static
-void View::ConvertPointFromWidget(View *source, gfx::Point* p) {
+void View::ConvertPointFromWidget(const View* dest, gfx::Point* p) {
gfx::Point t;
- ConvertPointToWidget(source, &t);
+ ConvertPointToWidget(dest, &t);
p->SetPoint(p->x() - t.x(), p->y() - t.y());
}
// static
-void View::ConvertPointToScreen(View* src, gfx::Point* p) {
+void View::ConvertPointToScreen(const View* src, gfx::Point* p) {
DCHECK(src);
DCHECK(p);