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

Side by Side Diff: Source/web/DateTimeChooserImpl.cpp

Issue 275043002: Oilpan: Prepare moving DateTimeChooser to Oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 , m_client(client) 53 , m_client(client)
54 , m_popup(0) 54 , m_popup(0)
55 , m_parameters(parameters) 55 , m_parameters(parameters)
56 , m_locale(WebCore::Locale::create(parameters.locale)) 56 , m_locale(WebCore::Locale::create(parameters.locale))
57 { 57 {
58 ASSERT(m_chromeClient); 58 ASSERT(m_chromeClient);
59 ASSERT(m_client); 59 ASSERT(m_client);
60 m_popup = m_chromeClient->openPagePopup(this, m_parameters.anchorRectInRootV iew); 60 m_popup = m_chromeClient->openPagePopup(this, m_parameters.anchorRectInRootV iew);
61 } 61 }
62 62
63 PassRefPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeClientImpl* ch romeClient, WebCore::DateTimeChooserClient* client, const WebCore::DateTimeChoos erParameters& parameters) 63 PassRefPtrWillBeRawPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeCl ientImpl* chromeClient, WebCore::DateTimeChooserClient* client, const WebCore::D ateTimeChooserParameters& parameters)
64 { 64 {
65 return adoptRef(new DateTimeChooserImpl(chromeClient, client, parameters)); 65 return adoptRefWillBeNoop(new DateTimeChooserImpl(chromeClient, client, para meters));
66 } 66 }
67 67
68 DateTimeChooserImpl::~DateTimeChooserImpl() 68 DateTimeChooserImpl::~DateTimeChooserImpl()
69 { 69 {
70 } 70 }
71 71
72 void DateTimeChooserImpl::endChooser() 72 void DateTimeChooserImpl::endChooser()
73 { 73 {
74 if (!m_popup) 74 if (!m_popup)
75 return; 75 return;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 addString("</script></body>\n", data); 167 addString("</script></body>\n", data);
168 } 168 }
169 169
170 WebCore::Locale& DateTimeChooserImpl::locale() 170 WebCore::Locale& DateTimeChooserImpl::locale()
171 { 171 {
172 return *m_locale; 172 return *m_locale;
173 } 173 }
174 174
175 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri ngValue) 175 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri ngValue)
176 { 176 {
177 RefPtr<DateTimeChooserImpl> protector(this); 177 RefPtrWillBeRawPtr<DateTimeChooserImpl> protector(this);
178 if (numValue >= 0) 178 if (numValue >= 0)
179 setValue(stringValue); 179 setValue(stringValue);
180 endChooser(); 180 endChooser();
181 } 181 }
182 182
183 void DateTimeChooserImpl::setValue(const String& value) 183 void DateTimeChooserImpl::setValue(const String& value)
184 { 184 {
185 m_client->didChooseValue(value); 185 m_client->didChooseValue(value);
186 } 186 }
187 187
188 void DateTimeChooserImpl::closePopup() 188 void DateTimeChooserImpl::closePopup()
189 { 189 {
190 endChooser(); 190 endChooser();
191 } 191 }
192 192
193 void DateTimeChooserImpl::didClosePopup() 193 void DateTimeChooserImpl::didClosePopup()
194 { 194 {
195 ASSERT(m_client); 195 ASSERT(m_client);
196 m_popup = 0; 196 m_popup = 0;
197 m_client->didEndChooser(); 197 m_client->didEndChooser();
198 } 198 }
199 199
200 void DateTimeChooserImpl::trace(Visitor* visitor)
201 {
202 visitor->trace(m_client);
203 DateTimeChooser::trace(visitor);
204 }
205
200 } // namespace blink 206 } // namespace blink
201 207
202 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) 208 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI)
OLDNEW
« Source/web/DateTimeChooserImpl.h ('K') | « Source/web/DateTimeChooserImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698