OLD | NEW |
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 "chrome/browser/ui/extensions/shell_window.h" | 5 #include "chrome/browser/ui/extensions/shell_window.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 user_gesture, was_blocked); | 295 user_gesture, was_blocked); |
296 } | 296 } |
297 | 297 |
298 void ShellWindow::HandleKeyboardEvent( | 298 void ShellWindow::HandleKeyboardEvent( |
299 WebContents* source, | 299 WebContents* source, |
300 const content::NativeWebKeyboardEvent& event) { | 300 const content::NativeWebKeyboardEvent& event) { |
301 DCHECK_EQ(source, web_contents_); | 301 DCHECK_EQ(source, web_contents_); |
302 native_app_window_->HandleKeyboardEvent(event); | 302 native_app_window_->HandleKeyboardEvent(event); |
303 } | 303 } |
304 | 304 |
| 305 void ShellWindow::RequestToLockMouse(WebContents* web_contents, |
| 306 bool user_gesture, |
| 307 bool last_unlocked_by_target) { |
| 308 web_contents->GotResponseToLockMouseRequest( |
| 309 extension_->HasAPIPermission(extensions::APIPermission::kPointerLock)); |
| 310 } |
| 311 |
305 void ShellWindow::OnNativeClose() { | 312 void ShellWindow::OnNativeClose() { |
306 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); | 313 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
307 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 314 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
308 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); | 315 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
309 delete this; | 316 delete this; |
310 } | 317 } |
311 | 318 |
312 void ShellWindow::OnNativeWindowChanged() { | 319 void ShellWindow::OnNativeWindowChanged() { |
313 SaveWindowPosition(); | 320 SaveWindowPosition(); |
314 if (!native_app_window_ || !web_contents_) | 321 if (!native_app_window_ || !web_contents_) |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 const extensions::DraggableRegion& region = *iter; | 542 const extensions::DraggableRegion& region = *iter; |
536 sk_region->op( | 543 sk_region->op( |
537 region.bounds.x(), | 544 region.bounds.x(), |
538 region.bounds.y(), | 545 region.bounds.y(), |
539 region.bounds.right(), | 546 region.bounds.right(), |
540 region.bounds.bottom(), | 547 region.bounds.bottom(), |
541 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 548 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
542 } | 549 } |
543 return sk_region; | 550 return sk_region; |
544 } | 551 } |
OLD | NEW |