Chromium Code Reviews| Index: chrome/browser/ui/exclusive_access/exclusive_access_manager.h |
| diff --git a/content/renderer/geolocation_dispatcher.h b/chrome/browser/ui/exclusive_access/exclusive_access_manager.h |
| similarity index 11% |
| copy from content/renderer/geolocation_dispatcher.h |
| copy to chrome/browser/ui/exclusive_access/exclusive_access_manager.h |
| index 391e65d105d264a9d96ab27f620163c545ef6965..b6f804f17d3238b795f133c2841e632e020b893c 100644 |
| --- a/content/renderer/geolocation_dispatcher.h |
| +++ b/chrome/browser/ui/exclusive_access/exclusive_access_manager.h |
| @@ -1,64 +1,63 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2015 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 CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ |
| -#define CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ |
| +#ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_MANAGER_H_ |
|
miu
2015/01/16 22:17:39
Your git cl --similarity=X setting might be too lo
Sriram
2015/01/21 01:38:57
I used 10% but tried a few value and even at 11% m
miu
2015/01/22 00:47:15
Not that I know of. Yeah, just prefer retaining h
|
| +#define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_MANAGER_H_ |
| #include "base/memory/scoped_ptr.h" |
| -#include "content/common/geolocation_service.mojom.h" |
| -#include "content/common/permission_service.mojom.h" |
| -#include "content/public/renderer/render_frame_observer.h" |
| -#include "third_party/WebKit/public/web/WebGeolocationClient.h" |
| -#include "third_party/WebKit/public/web/WebGeolocationController.h" |
| - |
| -namespace blink { |
| -class WebGeolocationController; |
| -class WebGeolocationPermissionRequest; |
| -class WebGeolocationPermissionRequestManager; |
| -class WebGeolocationPosition; |
| -} |
| +#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" |
| + |
| +class Browser; |
| +class BrowserWindow; |
| +class FullscreenController; |
| +class GURL; |
| +class MouseLockController; |
| namespace content { |
| -struct Geoposition; |
| - |
| -// GeolocationDispatcher is a delegate for Geolocation messages used by |
| -// WebKit. |
| -// It's the complement of GeolocationDispatcherHost. |
| -class GeolocationDispatcher |
| - : public RenderFrameObserver, |
| - public blink::WebGeolocationClient { |
| +class WebContents; |
| +} |
| + |
| +// This class combines the different exclusive access modes (like fullscreen and |
| +// mouse lock) which are each handled by respective controller. It also update |
| +// the exit bubble to reflect the combined state. |
| +class ExclusiveAccessManager { |
| public: |
| - explicit GeolocationDispatcher(RenderFrame* render_frame); |
| - virtual ~GeolocationDispatcher(); |
| + explicit ExclusiveAccessManager(Browser* browser); |
| + ~ExclusiveAccessManager(); |
| + |
| + FullscreenController* GetFullscreenController(); |
|
miu
2015/01/16 22:17:39
Trivial accessors should be inlined:
Fullscreen
Sriram
2015/01/21 01:38:57
Done.
|
| + MouseLockController* GetMouseLockController(); |
| + |
| + ExclusiveAccessBubbleType GetExclusiveAccessExitBubbleType() const; |
| + void UpdateExclusiveAccessExitBubbleContent(); |
| + |
| + GURL GetExclusiveAccessBubbleURL() const; |
| + // Callbacks //////////////////////////////////////////////////////////////// |
|
miu
2015/01/16 22:17:38
nit: Add newline above this line.
Sriram
2015/01/21 01:38:57
Done.
|
| + |
| + // Called by Browser::TabDeactivated. |
| + void OnTabDeactivated(content::WebContents* web_contents); |
| + |
| + // Called by Browser::ActiveTabChanged. |
| + void OnTabDetachedFromView(content::WebContents* web_contents); |
| + |
| + // Called by Browser::TabClosingAt. |
| + void OnTabClosing(content::WebContents* web_contents); |
| + |
| + // Called by Browser::PreHandleKeyboardEvent |
| + bool HandleUserPressedEscape(); |
| + |
| + // Called by platform ExclusiveAccessExitBubble. |
| + void OnAcceptExclusiveAccessPermission(); |
| + void OnDenyExclusiveAccessPermission(); |
| private: |
| - // WebGeolocationClient |
| - virtual void startUpdating(); |
| - virtual void stopUpdating(); |
| - virtual void setEnableHighAccuracy(bool enable_high_accuracy); |
| - virtual void setController(blink::WebGeolocationController* controller); |
| - virtual bool lastPosition(blink::WebGeolocationPosition& position); |
| - virtual void requestPermission( |
| - const blink::WebGeolocationPermissionRequest& permissionRequest); |
| - virtual void cancelPermissionRequest( |
| - const blink::WebGeolocationPermissionRequest& permissionRequest); |
| - |
| - void QueryNextPosition(); |
| - void OnPositionUpdate(MojoGeopositionPtr geoposition); |
| - |
| - // Permission for using geolocation has been set. |
| - void OnPermissionSet(int permission_request_id, PermissionStatus status); |
| - |
| - scoped_ptr<blink::WebGeolocationController> controller_; |
| - |
| - scoped_ptr<blink::WebGeolocationPermissionRequestManager> |
| - pending_permissions_; |
| - GeolocationServicePtr geolocation_service_; |
| - bool enable_high_accuracy_; |
| - PermissionServicePtr permission_service_; |
| -}; |
| + Browser* browser_; |
|
miu
2015/01/16 22:17:38
nit: Browser* const browser_;
Sriram
2015/01/21 01:38:57
Done.
|
| + BrowserWindow* window_; |
|
miu
2015/01/16 22:17:38
You can remove this: It is unused. Also, the forw
Sriram
2015/01/21 01:38:57
Done.
|
| + scoped_ptr<FullscreenController> fullscreen_controller_; |
|
miu
2015/01/16 22:17:38
Remove extra indirection and heap objects:
Full
Sriram
2015/01/21 01:38:57
Done.
|
| + scoped_ptr<MouseLockController> mouse_lock_controller_; |
| -} // namespace content |
| + DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessManager); |
| +}; |
| -#endif // CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ |
| +#endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_MANAGER_H_ |