| OLD | NEW |
| 1 // Copyright (c) 2010 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 #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_ | 5 #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_ |
| 6 #define VIEWS_WINDOW_CLIENT_VIEW_H_ | 6 #define VIEWS_WINDOW_CLIENT_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "views/view.h" | 9 #include "views/view.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class ClientView : public View { | 24 class ClientView : public View { |
| 25 public: | 25 public: |
| 26 // Constructs a ClientView object for the specified window with the specified | 26 // Constructs a ClientView object for the specified window with the specified |
| 27 // contents. Since this object is created during the process of creating | 27 // contents. Since this object is created during the process of creating |
| 28 // |window|, |contents_view| must be valid if you want the initial size of | 28 // |window|, |contents_view| must be valid if you want the initial size of |
| 29 // the window to be based on |contents_view|'s preferred size. | 29 // the window to be based on |contents_view|'s preferred size. |
| 30 ClientView(Window* window, View* contents_view); | 30 ClientView(Window* window, View* contents_view); |
| 31 virtual ~ClientView() {} | 31 virtual ~ClientView() {} |
| 32 | 32 |
| 33 // Manual RTTI ftw. | 33 // Manual RTTI ftw. |
| 34 virtual DialogClientView* AsDialogClientView() { return NULL; } | 34 virtual DialogClientView* AsDialogClientView(); |
| 35 | 35 |
| 36 // Returns true to signal that the Window can be closed. Specialized | 36 // Returns true to signal that the Window can be closed. Specialized |
| 37 // ClientView subclasses can override this default behavior to allow the | 37 // ClientView subclasses can override this default behavior to allow the |
| 38 // close to be blocked until the user corrects mistakes, accepts a warning | 38 // close to be blocked until the user corrects mistakes, accepts a warning |
| 39 // dialog, etc. | 39 // dialog, etc. |
| 40 virtual bool CanClose() { return true; } | 40 virtual bool CanClose(); |
| 41 | 41 |
| 42 // Notification that the window is closing. The default implementation | 42 // Notification that the window is closing. The default implementation |
| 43 // forwards the notification to the delegate. | 43 // forwards the notification to the delegate. |
| 44 virtual void WindowClosing(); | 44 virtual void WindowClosing(); |
| 45 | 45 |
| 46 // Tests to see if the specified point (in view coordinates) is within the | 46 // Tests to see if the specified point (in view coordinates) is within the |
| 47 // bounds of this view. If so, it returns HTCLIENT in this default | 47 // bounds of this view. If so, it returns HTCLIENT in this default |
| 48 // implementation. If it is outside the bounds of this view, this must return | 48 // implementation. If it is outside the bounds of this view, this must return |
| 49 // HTNOWHERE to tell the caller to do further processing to determine where | 49 // HTNOWHERE to tell the caller to do further processing to determine where |
| 50 // in the non-client area it is (if it is). | 50 // in the non-client area it is (if it is). |
| (...skipping 25 matching lines...) Expand all Loading... |
| 76 // The Window that hosts this ClientView. | 76 // The Window that hosts this ClientView. |
| 77 Window* window_; | 77 Window* window_; |
| 78 | 78 |
| 79 // The View that this ClientView contains. | 79 // The View that this ClientView contains. |
| 80 View* contents_view_; | 80 View* contents_view_; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace views | 83 } // namespace views |
| 84 | 84 |
| 85 #endif // #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_ | 85 #endif // #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_ |
| OLD | NEW |