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

Side by Side Diff: Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 closeDateTimeChooser(); 42 closeDateTimeChooser();
43 } 43 }
44 44
45 void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*) 45 void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*)
46 { 46 {
47 if (element()->isDisabledOrReadOnly() || !element()->renderer() || !ScriptCo ntroller::processingUserGesture()) 47 if (element()->isDisabledOrReadOnly() || !element()->renderer() || !ScriptCo ntroller::processingUserGesture())
48 return; 48 return;
49 49
50 if (m_dateTimeChooser) 50 if (m_dateTimeChooser)
51 return; 51 return;
52 if (!element()->document()->page()) 52 if (!element()->document().page())
53 return; 53 return;
54 DateTimeChooserParameters parameters; 54 DateTimeChooserParameters parameters;
55 if (!element()->setupDateTimeChooserParameters(parameters)) 55 if (!element()->setupDateTimeChooserParameters(parameters))
56 return; 56 return;
57 m_dateTimeChooser = element()->document()->page()->chrome().openDateTimeChoo ser(this, parameters); 57 m_dateTimeChooser = element()->document().page()->chrome().openDateTimeChoos er(this, parameters);
58 } 58 }
59 59
60 void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree() 60 void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree()
61 { 61 {
62 DEFINE_STATIC_LOCAL(AtomicString, valueContainerPseudo, ("-webkit-date-and-t ime-value", AtomicString::ConstructFromLiteral)); 62 DEFINE_STATIC_LOCAL(AtomicString, valueContainerPseudo, ("-webkit-date-and-t ime-value", AtomicString::ConstructFromLiteral));
63 63
64 RefPtr<HTMLDivElement> valueContainer = HTMLDivElement::create(element()->do cument()); 64 RefPtr<HTMLDivElement> valueContainer = HTMLDivElement::create(&element()->d ocument());
65 valueContainer->setPart(valueContainerPseudo); 65 valueContainer->setPart(valueContainerPseudo);
66 element()->userAgentShadowRoot()->appendChild(valueContainer.get()); 66 element()->userAgentShadowRoot()->appendChild(valueContainer.get());
67 updateAppearance(); 67 updateAppearance();
68 } 68 }
69 69
70 void BaseChooserOnlyDateAndTimeInputType::updateAppearance() 70 void BaseChooserOnlyDateAndTimeInputType::updateAppearance()
71 { 71 {
72 Node* node = element()->userAgentShadowRoot()->firstChild(); 72 Node* node = element()->userAgentShadowRoot()->firstChild();
73 if (!node || !node->isHTMLElement()) 73 if (!node || !node->isHTMLElement())
74 return; 74 return;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents) 126 void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents)
127 { 127 {
128 BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents); 128 BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents);
129 BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents); 129 BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents);
130 } 130 }
131 131
132 } 132 }
133 #endif 133 #endif
OLDNEW
« no previous file with comments | « Source/core/html/BaseButtonInputType.cpp ('k') | Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698