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

Unified Diff: webkit/tools/test_shell/test_geolocation_service.h

Issue 5938002: Remove legacy non-client-based geolocation code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove non-client-based geolocation code. Created 9 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/test_geolocation_service.h
diff --git a/webkit/tools/test_shell/test_geolocation_service.h b/webkit/tools/test_shell/test_geolocation_service.h
deleted file mode 100644
index cd6ce0016856919b5c9ba6141053842121c88486..0000000000000000000000000000000000000000
--- a/webkit/tools/test_shell/test_geolocation_service.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_GEOLOCATION_SERVICE_H_
-#define WEBKIT_TOOLS_TEST_SHELL_TEST_GEOLOCATION_SERVICE_H_
-
-#include "base/id_map.h"
-#include "base/timer.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationService.h"
-
-namespace WebKit {
-class WebURL;
-} // namespace WebKit
-
-// This class short-circuits the browser side of Geolocation permission
-// management: instead of going all the way up to GeolocationPermissionContext,
-// InfoBar, GeolocationContentSettingsMap, etc., we send a pre-arranged response
-// here. The flow is basically:
-//
-// 1. LayoutTestController::setGeolocationPermission is exposed to JS,
-// which then calls TestGeolocationService::SetGeolocationPermission(). This
-// response will be used for all subsequent geolocation requests.
-//
-// 2. WebKit::WebGeolocationServiceBridge attaches to us via attachBridge(), and
-// eventually calls requestPermissionForFrame().
-//
-// 3. We then callback into it, setting its permission (we yield the callstack
-// using a timer since WebKit doesn't expect the response to be synchronous).
-//
-// Note: WebKit provides a mock for position and error updates. For browser-side
-// and end-to-end tests, check geolocation_browsertest.cc and
-// geolocation_permission_context_unittest.cc.
-class TestGeolocationService : public WebKit::WebGeolocationService {
- public:
- TestGeolocationService();
- virtual ~TestGeolocationService();
-
- void SetGeolocationPermission(bool allowed);
-
- virtual void requestPermissionForFrame(int bridgeId,
- const WebKit::WebURL& url);
-
- virtual int attachBridge(WebKit::WebGeolocationServiceBridge* bridge);
- virtual void detachBridge(int bridgeId);
-
- private:
- void TryToSendPermissions();
- void SendPermission();
-
- // Holds the value of |allowed| in most recent SetGeolocationPermission call.
- bool allowed_;
- // Remains false until the first SetGeolocationPermission call.
- bool permission_set_;
-
- IDMap<WebKit::WebGeolocationServiceBridge> bridges_map_;
-
- base::OneShotTimer<TestGeolocationService> permission_timer_;
-
- // In-order vector of pending bridge IDs. Is not pumped by
- // TryToSendPermissions until the first call to SetGeolocationPermission.
- std::vector<int> pending_permissions_;
-
- DISALLOW_COPY_AND_ASSIGN(TestGeolocationService);
-};
-
-#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_GEOLOCATION_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698