| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_VIEWS_VIEWS_DELEGATE_H_ | 5 #ifndef UI_VIEWS_VIEWS_DELEGATE_H_ |
| 6 #define UI_VIEWS_VIEWS_DELEGATE_H_ | 6 #define UI_VIEWS_VIEWS_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include "base/string16.h" | 15 #include "base/string16.h" |
| 16 #include "ui/base/accessibility/accessibility_types.h" | 16 #include "ui/base/accessibility/accessibility_types.h" |
| 17 #include "ui/base/ui_base_types.h" | 17 #include "ui/base/ui_base_types.h" |
| 18 #include "ui/views/views_export.h" | 18 #include "ui/views/views_export.h" |
| 19 | 19 |
| 20 namespace gfx { | 20 namespace gfx { |
| 21 class Rect; | 21 class Rect; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ui { | 24 namespace ui { |
| 25 class Clipboard; | 25 class Clipboard; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace views { | 28 namespace views { |
| 29 | 29 |
| 30 class NonClientFrameView; |
| 30 class View; | 31 class View; |
| 31 class Widget; | 32 class Widget; |
| 32 | 33 |
| 33 // ViewsDelegate is an interface implemented by an object using the views | 34 // ViewsDelegate is an interface implemented by an object using the views |
| 34 // framework. It is used to obtain various high level application utilities | 35 // framework. It is used to obtain various high level application utilities |
| 35 // and perform some actions such as window placement saving. | 36 // and perform some actions such as window placement saving. |
| 36 // | 37 // |
| 37 // The embedding app must set views_delegate to assign its ViewsDelegate | 38 // The embedding app must set views_delegate to assign its ViewsDelegate |
| 38 // implementation. | 39 // implementation. |
| 39 class VIEWS_EXPORT ViewsDelegate { | 40 class VIEWS_EXPORT ViewsDelegate { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 70 const string16& menu_item_name, | 71 const string16& menu_item_name, |
| 71 int item_index, | 72 int item_index, |
| 72 int item_count, | 73 int item_count, |
| 73 bool has_submenu) = 0; | 74 bool has_submenu) = 0; |
| 74 | 75 |
| 75 #if defined(OS_WIN) | 76 #if defined(OS_WIN) |
| 76 // Retrieves the default window icon to use for windows if none is specified. | 77 // Retrieves the default window icon to use for windows if none is specified. |
| 77 virtual HICON GetDefaultWindowIcon() const = 0; | 78 virtual HICON GetDefaultWindowIcon() const = 0; |
| 78 #endif | 79 #endif |
| 79 | 80 |
| 81 // Creates a default NonClientFrameView to be used for windows that don't |
| 82 // specify their own. If this function returns NULL, the |
| 83 // views::CustomFrameView type will be used. |
| 84 virtual NonClientFrameView* CreateDefaultNonClientFrameView( |
| 85 Widget* widget) = 0; |
| 86 |
| 80 // AddRef/ReleaseRef are invoked while a menu is visible. They are used to | 87 // AddRef/ReleaseRef are invoked while a menu is visible. They are used to |
| 81 // ensure we don't attempt to exit while a menu is showing. | 88 // ensure we don't attempt to exit while a menu is showing. |
| 82 virtual void AddRef() = 0; | 89 virtual void AddRef() = 0; |
| 83 virtual void ReleaseRef() = 0; | 90 virtual void ReleaseRef() = 0; |
| 84 | 91 |
| 85 // Converts views::Event::flags to a WindowOpenDisposition. | 92 // Converts views::Event::flags to a WindowOpenDisposition. |
| 86 virtual int GetDispositionForEvent(int event_flags) = 0; | 93 virtual int GetDispositionForEvent(int event_flags) = 0; |
| 87 }; | 94 }; |
| 88 | 95 |
| 89 } // namespace views | 96 } // namespace views |
| 90 | 97 |
| 91 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ | 98 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ |
| OLD | NEW |