OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void GeolocationController::cancelPermissionRequest(Geolocation* geolocation) | 94 void GeolocationController::cancelPermissionRequest(Geolocation* geolocation) |
95 { | 95 { |
96 if (m_client) | 96 if (m_client) |
97 m_client->cancelPermissionRequest(geolocation); | 97 m_client->cancelPermissionRequest(geolocation); |
98 } | 98 } |
99 | 99 |
100 void GeolocationController::positionChanged(GeolocationPosition* position) | 100 void GeolocationController::positionChanged(GeolocationPosition* position) |
101 { | 101 { |
102 position = InspectorInstrumentation::overrideGeolocationPosition(m_page, pos
ition); | 102 position = InspectorInstrumentation::overrideGeolocationPosition(m_page, pos
ition); |
103 if (!position) { | 103 if (!position) { |
104 errorOccurred(GeolocationError::create(GeolocationError::PositionUnavail
able, ASCIILiteral("PositionUnavailable")).get()); | 104 errorOccurred(GeolocationError::create(GeolocationError::PositionUnavail
able, "PositionUnavailable").get()); |
105 return; | 105 return; |
106 } | 106 } |
107 m_lastPosition = position; | 107 m_lastPosition = position; |
108 Vector<RefPtr<Geolocation> > observersVector; | 108 Vector<RefPtr<Geolocation> > observersVector; |
109 copyToVector(m_observers, observersVector); | 109 copyToVector(m_observers, observersVector); |
110 for (size_t i = 0; i < observersVector.size(); ++i) | 110 for (size_t i = 0; i < observersVector.size(); ++i) |
111 observersVector[i]->positionChanged(); | 111 observersVector[i]->positionChanged(); |
112 } | 112 } |
113 | 113 |
114 void GeolocationController::errorOccurred(GeolocationError* error) | 114 void GeolocationController::errorOccurred(GeolocationError* error) |
(...skipping 19 matching lines...) Expand all Loading... |
134 { | 134 { |
135 return "GeolocationController"; | 135 return "GeolocationController"; |
136 } | 136 } |
137 | 137 |
138 void provideGeolocationTo(Page* page, GeolocationClient* client) | 138 void provideGeolocationTo(Page* page, GeolocationClient* client) |
139 { | 139 { |
140 Supplement<Page>::provideTo(page, GeolocationController::supplementName(), G
eolocationController::create(page, client)); | 140 Supplement<Page>::provideTo(page, GeolocationController::supplementName(), G
eolocationController::create(page, client)); |
141 } | 141 } |
142 | 142 |
143 } // namespace WebCore | 143 } // namespace WebCore |
OLD | NEW |