| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_VIEWS_DELEGATE_H_ | 5 #ifndef VIEWS_VIEWS_DELEGATE_H_ |
| 6 #define VIEWS_VIEWS_DELEGATE_H_ | 6 #define VIEWS_VIEWS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 class Clipboard; | 13 class Clipboard; |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Rect; | 15 class Rect; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 | 19 |
| 20 // ViewsDelegate is an interface implemented by an object using the views | 20 // ViewsDelegate is an interface implemented by an object using the views |
| 21 // framework. It is used to obtain various high level application utilities | 21 // framework. It is used to obtain various high level application utilities |
| 22 // and perform some actions such as window placement saving. | 22 // and perform some actions such as window placement saving. |
| 23 // | 23 // |
| 24 // The embedding app must set views_delegate to assign its ViewsDelegate | 24 // The embedding app must set views_delegate to assign its ViewsDelegate |
| 25 // implementation. | 25 // implementation. |
| 26 class ViewsDelegate { | 26 class ViewsDelegate { |
| 27 public: | 27 public: |
| 28 virtual ~ViewsDelegate() {} |
| 29 |
| 28 // Gets the clipboard. | 30 // Gets the clipboard. |
| 29 virtual Clipboard* GetClipboard() const = 0; | 31 virtual Clipboard* GetClipboard() const = 0; |
| 30 | 32 |
| 31 // Saves the position, size and maximized state for the window with the | 33 // Saves the position, size and maximized state for the window with the |
| 32 // specified name. | 34 // specified name. |
| 33 virtual void SaveWindowPlacement(const std::wstring& window_name, | 35 virtual void SaveWindowPlacement(const std::wstring& window_name, |
| 34 const gfx::Rect& bounds, | 36 const gfx::Rect& bounds, |
| 35 bool maximized) = 0; | 37 bool maximized) = 0; |
| 36 | 38 |
| 37 // Retrieves the saved position and size for the window with the specified | 39 // Retrieves the saved position and size for the window with the specified |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 virtual void AddRef() = 0; | 56 virtual void AddRef() = 0; |
| 55 virtual void ReleaseRef() = 0; | 57 virtual void ReleaseRef() = 0; |
| 56 | 58 |
| 57 // The active ViewsDelegate used by the views system. | 59 // The active ViewsDelegate used by the views system. |
| 58 static ViewsDelegate* views_delegate; | 60 static ViewsDelegate* views_delegate; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 } // namespace views | 63 } // namespace views |
| 62 | 64 |
| 63 #endif // #ifndef VIEWS_VIEWS_DELEGATE_H_ | 65 #endif // #ifndef VIEWS_VIEWS_DELEGATE_H_ |
| OLD | NEW |