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

Side by Side Diff: xfa/fxfa/app/xfa_ffpushbutton.cpp

Issue 2422303003: Remove FWL Create methods, use new instead (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxfa/app/xfa_ffpushbutton.h" 7 #include "xfa/fxfa/app/xfa_ffpushbutton.h"
8 8
9 #include "xfa/fwl/core/cfwl_widgetmgr.h" 9 #include "xfa/fwl/core/cfwl_widgetmgr.h"
10 #include "xfa/fwl/core/fwl_noteimp.h" 10 #include "xfa/fwl/core/fwl_noteimp.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 CFX_RectF rtWidget; 45 CFX_RectF rtWidget;
46 GetRectWithoutRotate(rtWidget); 46 GetRectWithoutRotate(rtWidget);
47 CFX_Matrix mt; 47 CFX_Matrix mt;
48 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); 48 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
49 mt.Concat(mtRotate); 49 mt.Concat(mtRotate);
50 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), 50 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
51 pGS, &mt); 51 pGS, &mt);
52 } 52 }
53 FX_BOOL CXFA_FFPushButton::LoadWidget() { 53 FX_BOOL CXFA_FFPushButton::LoadWidget() {
54 ASSERT(!m_pNormalWidget); 54 ASSERT(!m_pNormalWidget);
55 CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); 55 CFWL_PushButton* pPushButton = new CFWL_PushButton;
56 if (pPushButton) { 56 if (pPushButton) {
Lei Zhang 2016/10/18 19:12:14 remove
dsinclair 2016/10/19 14:41:38 Done.
57 pPushButton->Initialize(); 57 pPushButton->Initialize();
58 } 58 }
59 m_pOldDelegate = pPushButton->SetDelegate(this); 59 m_pOldDelegate = pPushButton->SetDelegate(this);
60 m_pNormalWidget = pPushButton; 60 m_pNormalWidget = pPushButton;
61 m_pNormalWidget->SetLayoutItem(this); 61 m_pNormalWidget->SetLayoutItem(this);
62 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); 62 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
63 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); 63 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
64 pNoteDriver->RegisterEventTarget(pWidget, pWidget); 64 pNoteDriver->RegisterEventTarget(pWidget, pWidget);
65 m_pNormalWidget->LockUpdate(); 65 m_pNormalWidget->LockUpdate();
66 UpdateWidgetProperty(); 66 UpdateWidgetProperty();
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 pGraphics->SetLineWidth(fLineWidth); 237 pGraphics->SetLineWidth(fLineWidth);
238 CFX_Path path; 238 CFX_Path path;
239 path.Create(); 239 path.Create();
240 CFX_RectF rect; 240 CFX_RectF rect;
241 m_pNormalWidget->GetWidgetRect(rect); 241 m_pNormalWidget->GetWidgetRect(rect);
242 path.AddRectangle(0, 0, rect.width, rect.height); 242 path.AddRectangle(0, 0, rect.width, rect.height);
243 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); 243 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix);
244 } 244 }
245 } 245 }
246 } 246 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698