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

Unified Diff: xfa/fwl/core/ifwl_widget.h

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac Created 4 years, 1 month 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 | « xfa/fwl/core/ifwl_listbox.cpp ('k') | xfa/fwl/core/ifwl_widget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_widget.h
diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h
index 264ff67513396f4474c17609028a0ed2c2e80e05..e00998c39e8540fc0094457ae5bcb9c4246914c7 100644
--- a/xfa/fwl/core/ifwl_widget.h
+++ b/xfa/fwl/core/ifwl_widget.h
@@ -11,6 +11,7 @@
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_system.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fwl/core/cfwl_event.h"
#include "xfa/fwl/core/cfwl_themepart.h"
#include "xfa/fwl/core/fwl_widgethit.h"
@@ -112,8 +113,13 @@ class IFWL_Widget {
virtual IFWL_ThemeProvider* GetThemeProvider();
virtual FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
- IFWL_WidgetDelegate* GetCurrentDelegate();
- void SetCurrentDelegate(IFWL_WidgetDelegate* pDelegate);
+ IFWL_WidgetDelegate* GetDelegate() const { return m_pDelegate.get(); }
+ void SetDelegate(std::unique_ptr<IFWL_WidgetDelegate> delegate) {
+ m_pDelegate = std::move(delegate);
+ }
+ std::unique_ptr<IFWL_WidgetDelegate> ReleaseDelegate() {
+ return pdfium::WrapUnique<IFWL_WidgetDelegate>(m_pDelegate.release());
+ }
const IFWL_App* GetOwnerApp() const;
@@ -201,15 +207,9 @@ class IFWL_Widget {
FX_BOOL IsParent(IFWL_Widget* pParent);
- void SetDelegate(std::unique_ptr<IFWL_WidgetDelegate> delegate) {
- m_pDelegate = std::move(delegate);
- }
- IFWL_WidgetDelegate* GetDelegate() const { return m_pDelegate.get(); }
-
const IFWL_App* const m_pOwnerApp;
CFWL_WidgetMgr* const m_pWidgetMgr;
std::unique_ptr<CFWL_WidgetImpProperties> m_pProperties;
- IFWL_WidgetDelegate* m_pCurDelegate; // Not owned.
IFWL_Widget* m_pOuter;
void* m_pLayoutItem;
CFWL_Widget* m_pAssociate;
« no previous file with comments | « xfa/fwl/core/ifwl_listbox.cpp ('k') | xfa/fwl/core/ifwl_widget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698