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

Unified Diff: chrome/browser/ui/exclusive_access/mouse_lock_controller.cc

Issue 877413004: Refactor away the Browser* dependency in exclusive_access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken mac change Created 5 years, 10 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: chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
diff --git a/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc b/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
index 01a986b9cd0c8381732f2d4bd4beffec9ed432d4..8e3afb90779a4eaadb33e7288f7a4f70f62427d8 100644
--- a/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
+++ b/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
@@ -7,6 +7,8 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
+#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "content/public/browser/notification_service.h"
@@ -17,9 +19,8 @@
using content::RenderViewHost;
using content::WebContents;
-MouseLockController::MouseLockController(ExclusiveAccessManager* manager,
- Browser* browser)
- : ExclusiveAccessControllerBase(manager, browser),
+MouseLockController::MouseLockController(ExclusiveAccessManager* manager)
+ : ExclusiveAccessControllerBase(manager),
mouse_lock_state_(MOUSELOCK_NOT_REQUESTED) {
}
@@ -136,8 +137,10 @@ bool MouseLockController::OnAcceptExclusiveAccessPermission() {
if (mouse_lock && !IsMouseLocked()) {
DCHECK(IsMouseLockRequested());
- HostContentSettingsMap* settings_map =
- profile()->GetHostContentSettingsMap();
+ HostContentSettingsMap* settings_map = exclusive_access_manager()
+ ->context()
+ ->GetProfile()
+ ->GetHostContentSettingsMap();
GURL url = GetExclusiveAccessBubbleURL();
ContentSettingsPattern pattern = ContentSettingsPattern::FromURL(url);
@@ -237,7 +240,10 @@ ContentSetting MouseLockController::GetMouseLockSetting(const GURL& url) const {
->IsPrivilegedFullscreenForTab())
return CONTENT_SETTING_ALLOW;
- HostContentSettingsMap* settings_map = profile()->GetHostContentSettingsMap();
+ HostContentSettingsMap* settings_map = exclusive_access_manager()
+ ->context()
+ ->GetProfile()
+ ->GetHostContentSettingsMap();
return settings_map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string());
}
« no previous file with comments | « chrome/browser/ui/exclusive_access/mouse_lock_controller.h ('k') | chrome/browser/ui/views/exclusive_access_bubble_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698