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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2541 return true; | 2541 return true; |
2542 } | 2542 } |
2543 | 2543 |
2544 bool RenderWidgetHostViewAura::CanFocus() { | 2544 bool RenderWidgetHostViewAura::CanFocus() { |
2545 return popup_type_ == blink::WebPopupTypeNone; | 2545 return popup_type_ == blink::WebPopupTypeNone; |
2546 } | 2546 } |
2547 | 2547 |
2548 void RenderWidgetHostViewAura::OnCaptureLost() { | 2548 void RenderWidgetHostViewAura::OnCaptureLost() { |
2549 host_->LostCapture(); | 2549 host_->LostCapture(); |
2550 if (touch_editing_client_) | 2550 if (touch_editing_client_) |
2551 touch_editing_client_->EndTouchEditing(false); | 2551 touch_editing_client_->EndTouchEditing(); |
2552 } | 2552 } |
2553 | 2553 |
2554 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { | 2554 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { |
2555 bool has_backing_store = !!host_->GetBackingStore(false); | 2555 bool has_backing_store = !!host_->GetBackingStore(false); |
2556 if (has_backing_store) { | 2556 if (has_backing_store) { |
2557 paint_canvas_ = canvas; | 2557 paint_canvas_ = canvas; |
2558 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( | 2558 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( |
2559 host_->GetBackingStore(true)); | 2559 host_->GetBackingStore(true)); |
2560 paint_canvas_ = NULL; | 2560 paint_canvas_ = NULL; |
2561 backing_store->SkiaShowRect(gfx::Point(), canvas); | 2561 backing_store->SkiaShowRect(gfx::Point(), canvas); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 host_->SetInputMethodActive(false); | 3056 host_->SetInputMethodActive(false); |
3057 } | 3057 } |
3058 } else if (window_ == lost_focus) { | 3058 } else if (window_ == lost_focus) { |
3059 host_->SetActive(false); | 3059 host_->SetActive(false); |
3060 host_->Blur(); | 3060 host_->Blur(); |
3061 | 3061 |
3062 DetachFromInputMethod(); | 3062 DetachFromInputMethod(); |
3063 host_->SetInputMethodActive(false); | 3063 host_->SetInputMethodActive(false); |
3064 | 3064 |
3065 if (touch_editing_client_) | 3065 if (touch_editing_client_) |
3066 touch_editing_client_->EndTouchEditing(false); | 3066 touch_editing_client_->EndTouchEditing(); |
3067 | 3067 |
3068 // If we lose the focus while fullscreen, close the window; Pepper Flash | 3068 // If we lose the focus while fullscreen, close the window; Pepper Flash |
3069 // won't do it for us (unlike NPAPI Flash). However, we do not close the | 3069 // won't do it for us (unlike NPAPI Flash). However, we do not close the |
3070 // window if we lose the focus to a window on another display. | 3070 // window if we lose the focus to a window on another display. |
3071 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); | 3071 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); |
3072 bool focusing_other_display = | 3072 bool focusing_other_display = |
3073 gained_focus && screen->GetNumDisplays() > 1 && | 3073 gained_focus && screen->GetNumDisplays() > 1 && |
3074 (screen->GetDisplayNearestWindow(window_).id() != | 3074 (screen->GetDisplayNearestWindow(window_).id() != |
3075 screen->GetDisplayNearestWindow(gained_focus).id()); | 3075 screen->GetDisplayNearestWindow(gained_focus).id()); |
3076 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { | 3076 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3522 RenderWidgetHost* widget) { | 3522 RenderWidgetHost* widget) { |
3523 return new RenderWidgetHostViewAura(widget); | 3523 return new RenderWidgetHostViewAura(widget); |
3524 } | 3524 } |
3525 | 3525 |
3526 // static | 3526 // static |
3527 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3527 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3528 GetScreenInfoForWindow(results, NULL); | 3528 GetScreenInfoForWindow(results, NULL); |
3529 } | 3529 } |
3530 | 3530 |
3531 } // namespace content | 3531 } // namespace content |
OLD | NEW |