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

Side by Side Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 1822823002: Implement Chrome OS accessibility features to highlight focus, caret & cursor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 "chrome/browser/ui/views/chrome_views_delegate.h" 5 #include "chrome/browser/ui/views/chrome_views_delegate.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
14 #include "chrome/browser/ui/browser_window_state.h" 14 #include "chrome/browser/ui/browser_window_state.h"
15 #include "components/prefs/pref_service.h" 15 #include "components/prefs/pref_service.h"
16 #include "components/prefs/scoped_user_pref_update.h" 16 #include "components/prefs/scoped_user_pref_update.h"
17 #include "components/version_info/version_info.h" 17 #include "components/version_info/version_info.h"
18 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
19 #include "content/public/browser/context_factory.h" 19 #include "content/public/browser/context_factory.h"
20 #include "content/public/browser/focused_node_details.h"
21 #include "content/public/browser/notification_details.h"
22 #include "content/public/browser/notification_service.h"
23 #include "content/public/browser/notification_types.h"
20 #include "grit/chrome_unscaled_resources.h" 24 #include "grit/chrome_unscaled_resources.h"
21 #include "ui/base/resource/resource_bundle.h" 25 #include "ui/base/resource/resource_bundle.h"
22 #include "ui/base/ui_base_switches.h" 26 #include "ui/base/ui_base_switches.h"
23 #include "ui/gfx/geometry/rect.h" 27 #include "ui/gfx/geometry/rect.h"
24 #include "ui/gfx/screen.h" 28 #include "ui/gfx/screen.h"
25 #include "ui/views/controls/menu/menu_controller.h" 29 #include "ui/views/controls/menu/menu_controller.h"
26 #include "ui/views/widget/native_widget.h" 30 #include "ui/views/widget/native_widget.h"
27 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
28 32
29 #if defined(OS_WIN) 33 #if defined(OS_WIN)
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayMatching(*bounds); 250 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayMatching(*bounds);
247 bounds->AdjustToFit(display.work_area()); 251 bounds->AdjustToFit(display.work_area());
248 ash::wm::GetWindowState(window)->set_minimum_visibility(true); 252 ash::wm::GetWindowState(window)->set_minimum_visibility(true);
249 #endif 253 #endif
250 return true; 254 return true;
251 } 255 }
252 256
253 void ChromeViewsDelegate::NotifyAccessibilityEvent( 257 void ChromeViewsDelegate::NotifyAccessibilityEvent(
254 views::View* view, ui::AXEvent event_type) { 258 views::View* view, ui::AXEvent event_type) {
255 #if defined(USE_AURA) 259 #if defined(USE_AURA)
260 bool is_editable_node = false;
261 gfx::Rect bounds_in_screen = view->GetBoundsInScreen();
262 content::FocusedNodeDetails details = {is_editable_node, bounds_in_screen};
263 content::NotificationService::current()->Notify(
264 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
265 content::Source<views::View>(view),
266 content::Details<content::FocusedNodeDetails>(&details));
267
256 AutomationManagerAura::GetInstance()->HandleEvent( 268 AutomationManagerAura::GetInstance()->HandleEvent(
257 GetProfileForWindow(view->GetWidget()), view, event_type); 269 GetProfileForWindow(view->GetWidget()), view, event_type);
258 #endif 270 #endif
259 } 271 }
260 272
261 views::ViewsDelegate::ProcessMenuAcceleratorResult 273 views::ViewsDelegate::ProcessMenuAcceleratorResult
262 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( 274 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing(
263 const ui::Accelerator& accelerator) { 275 const ui::Accelerator& accelerator) {
264 #if defined(USE_ASH) 276 #if defined(USE_ASH)
265 // Handle ash accelerators only when a menu is opened on an ash desktop. 277 // Handle ash accelerators only when a menu is opened on an ash desktop.
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 return content::BrowserThread::GetBlockingPool(); 517 return content::BrowserThread::GetBlockingPool();
506 } 518 }
507 519
508 #if !defined(USE_ASH) 520 #if !defined(USE_ASH)
509 views::Widget::InitParams::WindowOpacity 521 views::Widget::InitParams::WindowOpacity
510 ChromeViewsDelegate::GetOpacityForInitParams( 522 ChromeViewsDelegate::GetOpacityForInitParams(
511 const views::Widget::InitParams& params) { 523 const views::Widget::InitParams& params) {
512 return views::Widget::InitParams::OPAQUE_WINDOW; 524 return views::Widget::InitParams::OPAQUE_WINDOW;
513 } 525 }
514 #endif 526 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698