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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 138033014: Consistent fading behavior for touch editing handles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 "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 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 return true; 2539 return true;
2540 } 2540 }
2541 2541
2542 bool RenderWidgetHostViewAura::CanFocus() { 2542 bool RenderWidgetHostViewAura::CanFocus() {
2543 return popup_type_ == blink::WebPopupTypeNone; 2543 return popup_type_ == blink::WebPopupTypeNone;
2544 } 2544 }
2545 2545
2546 void RenderWidgetHostViewAura::OnCaptureLost() { 2546 void RenderWidgetHostViewAura::OnCaptureLost() {
2547 host_->LostCapture(); 2547 host_->LostCapture();
2548 if (touch_editing_client_) 2548 if (touch_editing_client_)
2549 touch_editing_client_->EndTouchEditing(); 2549 touch_editing_client_->EndTouchEditing(false);
2550 } 2550 }
2551 2551
2552 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { 2552 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
2553 bool has_backing_store = !!host_->GetBackingStore(false); 2553 bool has_backing_store = !!host_->GetBackingStore(false);
2554 if (has_backing_store) { 2554 if (has_backing_store) {
2555 paint_canvas_ = canvas; 2555 paint_canvas_ = canvas;
2556 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( 2556 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>(
2557 host_->GetBackingStore(true)); 2557 host_->GetBackingStore(true));
2558 paint_canvas_ = NULL; 2558 paint_canvas_ = NULL;
2559 backing_store->SkiaShowRect(gfx::Point(), canvas); 2559 backing_store->SkiaShowRect(gfx::Point(), canvas);
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
3054 host_->SetInputMethodActive(false); 3054 host_->SetInputMethodActive(false);
3055 } 3055 }
3056 } else if (window_ == lost_focus) { 3056 } else if (window_ == lost_focus) {
3057 host_->SetActive(false); 3057 host_->SetActive(false);
3058 host_->Blur(); 3058 host_->Blur();
3059 3059
3060 DetachFromInputMethod(); 3060 DetachFromInputMethod();
3061 host_->SetInputMethodActive(false); 3061 host_->SetInputMethodActive(false);
3062 3062
3063 if (touch_editing_client_) 3063 if (touch_editing_client_)
3064 touch_editing_client_->EndTouchEditing(); 3064 touch_editing_client_->EndTouchEditing(false);
3065 3065
3066 // If we lose the focus while fullscreen, close the window; Pepper Flash 3066 // If we lose the focus while fullscreen, close the window; Pepper Flash
3067 // won't do it for us (unlike NPAPI Flash). However, we do not close the 3067 // won't do it for us (unlike NPAPI Flash). However, we do not close the
3068 // window if we lose the focus to a window on another display. 3068 // window if we lose the focus to a window on another display.
3069 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); 3069 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_);
3070 bool focusing_other_display = 3070 bool focusing_other_display =
3071 gained_focus && screen->GetNumDisplays() > 1 && 3071 gained_focus && screen->GetNumDisplays() > 1 &&
3072 (screen->GetDisplayNearestWindow(window_).id() != 3072 (screen->GetDisplayNearestWindow(window_).id() !=
3073 screen->GetDisplayNearestWindow(gained_focus).id()); 3073 screen->GetDisplayNearestWindow(gained_focus).id());
3074 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { 3074 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
3520 RenderWidgetHost* widget) { 3520 RenderWidgetHost* widget) {
3521 return new RenderWidgetHostViewAura(widget); 3521 return new RenderWidgetHostViewAura(widget);
3522 } 3522 }
3523 3523
3524 // static 3524 // static
3525 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3525 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3526 GetScreenInfoForWindow(results, NULL); 3526 GetScreenInfoForWindow(results, NULL);
3527 } 3527 }
3528 3528
3529 } // namespace content 3529 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698