| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 user_gesture, was_blocked); | 274 user_gesture, was_blocked); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void ShellWindow::HandleKeyboardEvent( | 277 void ShellWindow::HandleKeyboardEvent( |
| 278 WebContents* source, | 278 WebContents* source, |
| 279 const content::NativeWebKeyboardEvent& event) { | 279 const content::NativeWebKeyboardEvent& event) { |
| 280 DCHECK_EQ(source, web_contents_); | 280 DCHECK_EQ(source, web_contents_); |
| 281 native_window_->HandleKeyboardEvent(event); | 281 native_window_->HandleKeyboardEvent(event); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void ShellWindow::RequestToLockMouse(WebContents* web_contents, |
| 285 bool user_gesture, |
| 286 bool last_unlocked_by_target) { |
| 287 web_contents->GotResponseToLockMouseRequest( |
| 288 extension_->HasAPIPermission(extensions::APIPermission::kPointerLock)); |
| 289 } |
| 290 |
| 284 void ShellWindow::OnNativeClose() { | 291 void ShellWindow::OnNativeClose() { |
| 285 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); | 292 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
| 286 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 293 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
| 287 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); | 294 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
| 288 delete this; | 295 delete this; |
| 289 } | 296 } |
| 290 | 297 |
| 291 void ShellWindow::OnNativeWindowChanged() { | 298 void ShellWindow::OnNativeWindowChanged() { |
| 292 SaveWindowPosition(); | 299 SaveWindowPosition(); |
| 293 if (!native_window_ || !web_contents_) | 300 if (!native_window_ || !web_contents_) |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 const extensions::DraggableRegion& region = *iter; | 521 const extensions::DraggableRegion& region = *iter; |
| 515 sk_region->op( | 522 sk_region->op( |
| 516 region.bounds.x(), | 523 region.bounds.x(), |
| 517 region.bounds.y(), | 524 region.bounds.y(), |
| 518 region.bounds.right(), | 525 region.bounds.right(), |
| 519 region.bounds.bottom(), | 526 region.bounds.bottom(), |
| 520 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 527 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 521 } | 528 } |
| 522 return sk_region; | 529 return sk_region; |
| 523 } | 530 } |
| OLD | NEW |