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

Unified Diff: chrome/views/non_client_view.cc

Issue 27286: All views::Window objects must have a NonClientView, regardless of whether or... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/views/non_client_view.h ('k') | chrome/views/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/non_client_view.cc
===================================================================
--- chrome/views/non_client_view.cc (revision 10621)
+++ chrome/views/non_client_view.cc (working copy)
@@ -3,12 +3,83 @@
// found in the LICENSE file.
#include "chrome/views/non_client_view.h"
+#include "chrome/views/widget.h"
namespace views {
const int NonClientView::kFrameShadowThickness = 1;
const int NonClientView::kClientEdgeThickness = 1;
+////////////////////////////////////////////////////////////////////////////////
+// NonClientView, public:
+
+NonClientView::NonClientView() : paint_as_active_(false) {
+}
+
+NonClientView::~NonClientView() {
+}
+
+bool NonClientView::CanClose() const {
+ return client_view_->CanClose();
+}
+
+void NonClientView::WindowClosing() {
+ client_view_->WindowClosing();
+}
+
+gfx::Rect NonClientView::CalculateClientAreaBounds(int width,
+ int height) const {
+ return gfx::Rect();
+}
+
+gfx::Size NonClientView::CalculateWindowSizeForClientSize(int width,
+ int height) const {
+ return gfx::Size();
+}
+
+gfx::Point NonClientView::GetSystemMenuPoint() const {
+ CPoint temp(0, -kFrameShadowThickness);
+ MapWindowPoints(GetWidget()->GetHWND(), HWND_DESKTOP, &temp, 1);
+ return gfx::Point(temp);
+}
+
+int NonClientView::NonClientHitTest(const gfx::Point& point) {
+ return client_view_->NonClientHitTest(point);
+}
+
+void NonClientView::GetWindowMask(const gfx::Size& size,
+ gfx::Path* window_mask) {
+}
+
+void NonClientView::EnableClose(bool enable) {
+}
+
+void NonClientView::ResetWindowControls() {
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NonClientView, View overrides:
+
+gfx::Size NonClientView::GetPreferredSize() {
+ return client_view_->GetPreferredSize();
+}
+
+void NonClientView::Layout() {
+ client_view_->SetBounds(0, 0, width(), height());
+}
+
+void NonClientView::ViewHierarchyChanged(bool is_add, View* parent,
+ View* child) {
+ // Add our Client View as we are added to the Widget so that if we are
+ // subsequently resized all the parent-child relationships are established.
+ if (is_add && GetWidget() && child == this)
+ AddChildView(client_view_);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NonClientView, protected:
+
int NonClientView::GetHTComponentForFrame(const gfx::Point& point,
int top_resize_border_height,
int resize_border_thickness,
« no previous file with comments | « chrome/views/non_client_view.h ('k') | chrome/views/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698