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

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

Issue 214243005: Fire accessibility focus/blur events on root web document. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fire event before fullscreen check destroys window Created 6 years, 8 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
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after
3109 input_method->SetFocusedTextInputClient(this); 3109 input_method->SetFocusedTextInputClient(this);
3110 host_->SetInputMethodActive(input_method->IsActive()); 3110 host_->SetInputMethodActive(input_method->IsActive());
3111 3111
3112 // Often the application can set focus to the view in response to a key 3112 // Often the application can set focus to the view in response to a key
3113 // down. However the following char event shouldn't be sent to the web 3113 // down. However the following char event shouldn't be sent to the web
3114 // page. 3114 // page.
3115 host_->SuppressNextCharEvents(); 3115 host_->SuppressNextCharEvents();
3116 } else { 3116 } else {
3117 host_->SetInputMethodActive(false); 3117 host_->SetInputMethodActive(false);
3118 } 3118 }
3119
3120 BrowserAccessibilityManager* manager = GetBrowserAccessibilityManager();
3121 if (manager)
3122 manager->OnWindowFocused();
3119 } else if (window_ == lost_focus) { 3123 } else if (window_ == lost_focus) {
3120 host_->SetActive(false); 3124 host_->SetActive(false);
3121 host_->Blur(); 3125 host_->Blur();
3122 3126
3123 DetachFromInputMethod(); 3127 DetachFromInputMethod();
3124 host_->SetInputMethodActive(false); 3128 host_->SetInputMethodActive(false);
3125 3129
3126 if (touch_editing_client_) 3130 if (touch_editing_client_)
3127 touch_editing_client_->EndTouchEditing(false); 3131 touch_editing_client_->EndTouchEditing(false);
3128 3132
3133 BrowserAccessibilityManager* manager = GetBrowserAccessibilityManager();
3134 if (manager)
3135 manager->OnWindowBlurred();
3136
3129 // If we lose the focus while fullscreen, close the window; Pepper Flash 3137 // If we lose the focus while fullscreen, close the window; Pepper Flash
3130 // won't do it for us (unlike NPAPI Flash). However, we do not close the 3138 // won't do it for us (unlike NPAPI Flash). However, we do not close the
3131 // window if we lose the focus to a window on another display. 3139 // window if we lose the focus to a window on another display.
3132 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); 3140 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_);
3133 bool focusing_other_display = 3141 bool focusing_other_display =
3134 gained_focus && screen->GetNumDisplays() > 1 && 3142 gained_focus && screen->GetNumDisplays() > 1 &&
3135 (screen->GetDisplayNearestWindow(window_).id() != 3143 (screen->GetDisplayNearestWindow(window_).id() !=
3136 screen->GetDisplayNearestWindow(gained_focus).id()); 3144 screen->GetDisplayNearestWindow(gained_focus).id());
3137 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { 3145 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) {
3138 #if defined(OS_WIN) 3146 #if defined(OS_WIN)
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3683 RenderWidgetHost* widget) { 3691 RenderWidgetHost* widget) {
3684 return new RenderWidgetHostViewAura(widget); 3692 return new RenderWidgetHostViewAura(widget);
3685 } 3693 }
3686 3694
3687 // static 3695 // static
3688 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3696 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3689 GetScreenInfoForWindow(results, NULL); 3697 GetScreenInfoForWindow(results, NULL);
3690 } 3698 }
3691 3699
3692 } // namespace content 3700 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698