OLD | NEW |
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 17 matching lines...) Expand all Loading... |
28 #include "web/ExternalDateTimeChooser.h" | 28 #include "web/ExternalDateTimeChooser.h" |
29 | 29 |
30 #include "core/InputTypeNames.h" | 30 #include "core/InputTypeNames.h" |
31 #include "platform/DateTimeChooserClient.h" | 31 #include "platform/DateTimeChooserClient.h" |
32 #include "public/web/WebDateTimeChooserCompletion.h" | 32 #include "public/web/WebDateTimeChooserCompletion.h" |
33 #include "public/web/WebDateTimeChooserParams.h" | 33 #include "public/web/WebDateTimeChooserParams.h" |
34 #include "public/web/WebViewClient.h" | 34 #include "public/web/WebViewClient.h" |
35 #include "web/ChromeClientImpl.h" | 35 #include "web/ChromeClientImpl.h" |
36 #include "wtf/text/AtomicString.h" | 36 #include "wtf/text/AtomicString.h" |
37 | 37 |
38 using namespace blink; | |
39 | |
40 namespace blink { | 38 namespace blink { |
41 | 39 |
42 class WebDateTimeChooserCompletionImpl : public WebDateTimeChooserCompletion { | 40 class WebDateTimeChooserCompletionImpl : public WebDateTimeChooserCompletion { |
43 public: | 41 public: |
44 WebDateTimeChooserCompletionImpl(ExternalDateTimeChooser* chooser) | 42 WebDateTimeChooserCompletionImpl(ExternalDateTimeChooser* chooser) |
45 : m_chooser(chooser) | 43 : m_chooser(chooser) |
46 { | 44 { |
47 } | 45 } |
48 | 46 |
49 private: | 47 private: |
(...skipping 15 matching lines...) Expand all Loading... |
65 delete this; | 63 delete this; |
66 } | 64 } |
67 | 65 |
68 RefPtrWillBePersistent<ExternalDateTimeChooser> m_chooser; | 66 RefPtrWillBePersistent<ExternalDateTimeChooser> m_chooser; |
69 }; | 67 }; |
70 | 68 |
71 ExternalDateTimeChooser::~ExternalDateTimeChooser() | 69 ExternalDateTimeChooser::~ExternalDateTimeChooser() |
72 { | 70 { |
73 } | 71 } |
74 | 72 |
75 ExternalDateTimeChooser::ExternalDateTimeChooser(blink::DateTimeChooserClient* c
lient) | 73 ExternalDateTimeChooser::ExternalDateTimeChooser(DateTimeChooserClient* client) |
76 : m_client(client) | 74 : m_client(client) |
77 { | 75 { |
78 ASSERT(client); | 76 ASSERT(client); |
79 } | 77 } |
80 | 78 |
81 PassRefPtrWillBeRawPtr<ExternalDateTimeChooser> ExternalDateTimeChooser::create(
ChromeClientImpl* chromeClient, WebViewClient* webViewClient, blink::DateTimeCho
oserClient* client, const blink::DateTimeChooserParameters& parameters) | 79 PassRefPtrWillBeRawPtr<ExternalDateTimeChooser> ExternalDateTimeChooser::create(
ChromeClientImpl* chromeClient, WebViewClient* webViewClient, DateTimeChooserCli
ent* client, const DateTimeChooserParameters& parameters) |
82 { | 80 { |
83 ASSERT(chromeClient); | 81 ASSERT(chromeClient); |
84 RefPtrWillBeRawPtr<ExternalDateTimeChooser> chooser = adoptRefWillBeNoop(new
ExternalDateTimeChooser(client)); | 82 RefPtrWillBeRawPtr<ExternalDateTimeChooser> chooser = adoptRefWillBeNoop(new
ExternalDateTimeChooser(client)); |
85 if (!chooser->openDateTimeChooser(chromeClient, webViewClient, parameters)) | 83 if (!chooser->openDateTimeChooser(chromeClient, webViewClient, parameters)) |
86 chooser.clear(); | 84 chooser.clear(); |
87 return chooser.release(); | 85 return chooser.release(); |
88 } | 86 } |
89 | 87 |
90 | 88 |
91 static WebDateTimeInputType toWebDateTimeInputType(const AtomicString& source) | 89 static WebDateTimeInputType toWebDateTimeInputType(const AtomicString& source) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 m_client->didEndChooser(); | 159 m_client->didEndChooser(); |
162 } | 160 } |
163 | 161 |
164 void ExternalDateTimeChooser::endChooser() | 162 void ExternalDateTimeChooser::endChooser() |
165 { | 163 { |
166 DateTimeChooserClient* client = m_client; | 164 DateTimeChooserClient* client = m_client; |
167 m_client = 0; | 165 m_client = 0; |
168 client->didEndChooser(); | 166 client->didEndChooser(); |
169 } | 167 } |
170 | 168 |
171 } | 169 } // namespace blink |
172 | 170 |
173 #endif | 171 #endif |
OLD | NEW |