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

Side by Side Diff: ui/aura/monitor_manager.cc

Issue 9808010: Keep the mouse cursor within desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/monitor_manager.h" 5 #include "ui/aura/monitor_manager.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "ui/aura/env.h" 9 #include "ui/aura/env.h"
10 #include "ui/aura/monitor.h" 10 #include "ui/aura/monitor.h"
11 #include "ui/aura/root_window.h"
11 #include "ui/aura/root_window_host.h" 12 #include "ui/aura/root_window_host.h"
12 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
13 14
14 namespace aura { 15 namespace aura {
15 namespace { 16 namespace {
16 // Default bounds for a monitor. 17 // Default bounds for a monitor.
17 static const int kDefaultHostWindowX = 200; 18 static const int kDefaultHostWindowX = 200;
18 static const int kDefaultHostWindowY = 200; 19 static const int kDefaultHostWindowY = 200;
19 static const int kDefaultHostWindowWidth = 1280; 20 static const int kDefaultHostWindowWidth = 1280;
20 static const int kDefaultHostWindowHeight = 1024; 21 static const int kDefaultHostWindowHeight = 1024;
(...skipping 16 matching lines...) Expand all
37 bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize()); 38 bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize());
38 } 39 }
39 Monitor* monitor = new Monitor(); 40 Monitor* monitor = new Monitor();
40 monitor->set_bounds(bounds); 41 monitor->set_bounds(bounds);
41 return monitor; 42 return monitor;
42 } 43 }
43 44
44 // static 45 // static
45 RootWindow* MonitorManager::CreateRootWindowForPrimaryMonitor() { 46 RootWindow* MonitorManager::CreateRootWindowForPrimaryMonitor() {
46 MonitorManager* manager = aura::Env::GetInstance()->monitor_manager(); 47 MonitorManager* manager = aura::Env::GetInstance()->monitor_manager();
47 return manager->CreateRootWindowForMonitor(manager->GetMonitorAt(0)); 48 RootWindow* root =
49 manager->CreateRootWindowForMonitor(manager->GetMonitorAt(0));
50 if (use_fullscreen_host_window_)
51 root->ConfineCursorToWindow();
52 return root;
48 } 53 }
49 54
50 MonitorManager::MonitorManager() { 55 MonitorManager::MonitorManager() {
51 } 56 }
52 57
53 MonitorManager::~MonitorManager() { 58 MonitorManager::~MonitorManager() {
54 } 59 }
55 60
56 void MonitorManager::AddObserver(MonitorObserver* observer) { 61 void MonitorManager::AddObserver(MonitorObserver* observer) {
57 observers_.AddObserver(observer); 62 observers_.AddObserver(observer);
(...skipping 12 matching lines...) Expand all
70 FOR_EACH_OBSERVER(MonitorObserver, observers_, 75 FOR_EACH_OBSERVER(MonitorObserver, observers_,
71 OnMonitorAdded(monitor)); 76 OnMonitorAdded(monitor));
72 } 77 }
73 78
74 void MonitorManager::NotifyMonitorRemoved(const Monitor* monitor) { 79 void MonitorManager::NotifyMonitorRemoved(const Monitor* monitor) {
75 FOR_EACH_OBSERVER(MonitorObserver, observers_, 80 FOR_EACH_OBSERVER(MonitorObserver, observers_,
76 OnMonitorRemoved(monitor)); 81 OnMonitorRemoved(monitor));
77 } 82 }
78 83
79 } // namespace aura 84 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698