| 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/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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/browser/ui/views/accessibility/accessibility_event_router_views
.h" | 15 #include "chrome/browser/ui/views/accessibility/accessibility_event_router_views
.h" |
| 16 #include "chrome/browser/ui/views/accessibility/automation_manager_views.h" | |
| 17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 18 #include "grit/chrome_unscaled_resources.h" | 17 #include "grit/chrome_unscaled_resources.h" |
| 19 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| 20 #include "ui/base/ui_base_switches.h" | 19 #include "ui/base/ui_base_switches.h" |
| 21 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
| 22 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
| 23 #include "ui/views/widget/native_widget.h" | 22 #include "ui/views/widget/native_widget.h" |
| 24 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
| 25 | 24 |
| 26 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 44 #include "ui/views/widget/native_widget_aura.h" | 43 #include "ui/views/widget/native_widget_aura.h" |
| 45 #endif | 44 #endif |
| 46 | 45 |
| 47 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 46 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 48 #include "ui/views/linux_ui/linux_ui.h" | 47 #include "ui/views/linux_ui/linux_ui.h" |
| 49 #endif | 48 #endif |
| 50 | 49 |
| 51 #if defined(USE_ASH) | 50 #if defined(USE_ASH) |
| 52 #include "ash/shell.h" | 51 #include "ash/shell.h" |
| 53 #include "ash/wm/window_state.h" | 52 #include "ash/wm/window_state.h" |
| 53 #include "chrome/browser/ui/ash/accessibility/automation_manager_views.h" |
| 54 #include "chrome/browser/ui/ash/ash_init.h" | 54 #include "chrome/browser/ui/ash/ash_init.h" |
| 55 #include "chrome/browser/ui/ash/ash_util.h" | 55 #include "chrome/browser/ui/ash/ash_util.h" |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 | 58 |
| 59 // Helpers -------------------------------------------------------------------- | 59 // Helpers -------------------------------------------------------------------- |
| 60 | 60 |
| 61 namespace { | 61 namespace { |
| 62 | 62 |
| 63 Profile* GetProfileForWindow(const views::Widget* window) { | 63 Profile* GetProfileForWindow(const views::Widget* window) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 #endif | 193 #endif |
| 194 return true; | 194 return true; |
| 195 } | 195 } |
| 196 | 196 |
| 197 void ChromeViewsDelegate::NotifyAccessibilityEvent( | 197 void ChromeViewsDelegate::NotifyAccessibilityEvent( |
| 198 views::View* view, ui::AXEvent event_type) { | 198 views::View* view, ui::AXEvent event_type) { |
| 199 AccessibilityEventRouterViews::GetInstance()->HandleAccessibilityEvent( | 199 AccessibilityEventRouterViews::GetInstance()->HandleAccessibilityEvent( |
| 200 view, event_type); | 200 view, event_type); |
| 201 | 201 |
| 202 #if defined(USE_ASH) |
| 202 AutomationManagerViews::GetInstance()->HandleEvent( | 203 AutomationManagerViews::GetInstance()->HandleEvent( |
| 203 GetProfileForWindow(view->GetWidget()), view, event_type); | 204 GetProfileForWindow(view->GetWidget()), view, event_type); |
| 205 #endif |
| 204 } | 206 } |
| 205 | 207 |
| 206 void ChromeViewsDelegate::NotifyMenuItemFocused( | 208 void ChromeViewsDelegate::NotifyMenuItemFocused( |
| 207 const base::string16& menu_name, | 209 const base::string16& menu_name, |
| 208 const base::string16& menu_item_name, | 210 const base::string16& menu_item_name, |
| 209 int item_index, | 211 int item_index, |
| 210 int item_count, | 212 int item_count, |
| 211 bool has_submenu) { | 213 bool has_submenu) { |
| 212 AccessibilityEventRouterViews::GetInstance()->HandleMenuItemFocused( | 214 AccessibilityEventRouterViews::GetInstance()->HandleMenuItemFocused( |
| 213 menu_name, menu_item_name, item_index, item_count, has_submenu); | 215 menu_name, menu_item_name, item_index, item_count, has_submenu); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 } | 411 } |
| 410 #endif | 412 #endif |
| 411 | 413 |
| 412 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 414 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
| 413 views::Widget::InitParams::WindowOpacity | 415 views::Widget::InitParams::WindowOpacity |
| 414 ChromeViewsDelegate::GetOpacityForInitParams( | 416 ChromeViewsDelegate::GetOpacityForInitParams( |
| 415 const views::Widget::InitParams& params) { | 417 const views::Widget::InitParams& params) { |
| 416 return views::Widget::InitParams::OPAQUE_WINDOW; | 418 return views::Widget::InitParams::OPAQUE_WINDOW; |
| 417 } | 419 } |
| 418 #endif | 420 #endif |
| OLD | NEW |