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

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

Issue 577018: Support app menu and double-click close on upper left corner of window, part ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 10 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/frame/opaque_browser_frame_view.h" 5 #include "chrome/browser/views/frame/opaque_browser_frame_view.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/font.h" 8 #include "app/gfx/font.h"
9 #include "app/gfx/path.h" 9 #include "app/gfx/path.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
11 #include "app/resource_bundle.h" 11 #include "app/resource_bundle.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( 276 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds(
277 const gfx::Rect& client_bounds) const { 277 const gfx::Rect& client_bounds) const {
278 int top_height = NonClientTopBorderHeight(); 278 int top_height = NonClientTopBorderHeight();
279 int border_thickness = NonClientBorderThickness(); 279 int border_thickness = NonClientBorderThickness();
280 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), 280 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness),
281 std::max(0, client_bounds.y() - top_height), 281 std::max(0, client_bounds.y() - top_height),
282 client_bounds.width() + (2 * border_thickness), 282 client_bounds.width() + (2 * border_thickness),
283 client_bounds.height() + top_height + border_thickness); 283 client_bounds.height() + top_height + border_thickness);
284 } 284 }
285 285
286 gfx::Point OpaqueBrowserFrameView::GetSystemMenuPoint() const {
287 gfx::Point system_menu_point(
288 MirroredXCoordinateInsideView(FrameBorderThickness()),
289 NonClientTopBorderHeight() + browser_view_->GetTabStripHeight() -
290 (frame_->GetWindow()->IsFullscreen() ? 0 : kClientEdgeThickness));
291 ConvertPointToScreen(this, &system_menu_point);
292 return system_menu_point;
293 }
294
295 int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { 286 int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) {
296 if (!bounds().Contains(point)) 287 if (!bounds().Contains(point))
297 return HTNOWHERE; 288 return HTNOWHERE;
298 289
299 int frame_component = 290 int frame_component =
300 frame_->GetWindow()->GetClientView()->NonClientHitTest(point); 291 frame_->GetWindow()->GetClientView()->NonClientHitTest(point);
301 if (frame_component != HTNOWHERE) 292 if (frame_component != HTNOWHERE)
302 return frame_component; 293 return frame_component;
303 294
304 // Then see if the point is within any of the window controls. 295 // Then see if the point is within any of the window controls.
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 static bool initialized = false; 1088 static bool initialized = false;
1098 if (!initialized) { 1089 if (!initialized) {
1099 #if defined(OS_WIN) 1090 #if defined(OS_WIN)
1100 title_font_ = new gfx::Font(win_util::GetWindowTitleFont()); 1091 title_font_ = new gfx::Font(win_util::GetWindowTitleFont());
1101 #else 1092 #else
1102 title_font_ = new gfx::Font(); 1093 title_font_ = new gfx::Font();
1103 #endif 1094 #endif
1104 initialized = true; 1095 initialized = true;
1105 } 1096 }
1106 } 1097 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698