| 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 13 matching lines...) Expand all Loading... |
| 40 #include "ui/views/widget/native_widget_aura.h" | 39 #include "ui/views/widget/native_widget_aura.h" |
| 41 #endif | 40 #endif |
| 42 | 41 |
| 43 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 42 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 44 #include "ui/views/linux_ui/linux_ui.h" | 43 #include "ui/views/linux_ui/linux_ui.h" |
| 45 #endif | 44 #endif |
| 46 | 45 |
| 47 #if defined(USE_ASH) | 46 #if defined(USE_ASH) |
| 48 #include "ash/shell.h" | 47 #include "ash/shell.h" |
| 49 #include "ash/wm/window_state.h" | 48 #include "ash/wm/window_state.h" |
| 49 #include "chrome/browser/ui/ash/accessibility/automation_manager_views.h" |
| 50 #include "chrome/browser/ui/ash/ash_init.h" | 50 #include "chrome/browser/ui/ash/ash_init.h" |
| 51 #include "chrome/browser/ui/ash/ash_util.h" | 51 #include "chrome/browser/ui/ash/ash_util.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 Profile* GetProfileForWindow(const views::Widget* window) { | 56 Profile* GetProfileForWindow(const views::Widget* window) { |
| 57 if (!window) | 57 if (!window) |
| 58 return NULL; | 58 return NULL; |
| 59 return reinterpret_cast<Profile*>( | 59 return reinterpret_cast<Profile*>( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 #endif | 145 #endif |
| 146 return true; | 146 return true; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ChromeViewsDelegate::NotifyAccessibilityEvent( | 149 void ChromeViewsDelegate::NotifyAccessibilityEvent( |
| 150 views::View* view, ui::AXEvent event_type) { | 150 views::View* view, ui::AXEvent event_type) { |
| 151 AccessibilityEventRouterViews::GetInstance()->HandleAccessibilityEvent( | 151 AccessibilityEventRouterViews::GetInstance()->HandleAccessibilityEvent( |
| 152 view, event_type); | 152 view, event_type); |
| 153 | 153 |
| 154 #if defined(USE_ASH) |
| 154 AutomationManagerViews::GetInstance()->HandleEvent( | 155 AutomationManagerViews::GetInstance()->HandleEvent( |
| 155 GetProfileForWindow(view->GetWidget()), view, event_type); | 156 GetProfileForWindow(view->GetWidget()), view, event_type); |
| 157 #endif |
| 156 } | 158 } |
| 157 | 159 |
| 158 void ChromeViewsDelegate::NotifyMenuItemFocused( | 160 void ChromeViewsDelegate::NotifyMenuItemFocused( |
| 159 const base::string16& menu_name, | 161 const base::string16& menu_name, |
| 160 const base::string16& menu_item_name, | 162 const base::string16& menu_item_name, |
| 161 int item_index, | 163 int item_index, |
| 162 int item_count, | 164 int item_count, |
| 163 bool has_submenu) { | 165 bool has_submenu) { |
| 164 AccessibilityEventRouterViews::GetInstance()->HandleMenuItemFocused( | 166 AccessibilityEventRouterViews::GetInstance()->HandleMenuItemFocused( |
| 165 menu_name, menu_item_name, item_index, item_count, has_submenu); | 167 menu_name, menu_item_name, item_index, item_count, has_submenu); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 return false; | 329 return false; |
| 328 } | 330 } |
| 329 | 331 |
| 330 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 332 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
| 331 views::Widget::InitParams::WindowOpacity | 333 views::Widget::InitParams::WindowOpacity |
| 332 ChromeViewsDelegate::GetOpacityForInitParams( | 334 ChromeViewsDelegate::GetOpacityForInitParams( |
| 333 const views::Widget::InitParams& params) { | 335 const views::Widget::InitParams& params) { |
| 334 return views::Widget::InitParams::OPAQUE_WINDOW; | 336 return views::Widget::InitParams::OPAQUE_WINDOW; |
| 335 } | 337 } |
| 336 #endif | 338 #endif |
| OLD | NEW |