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/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/lifetime/keep_alive_types.h" | 13 #include "chrome/browser/lifetime/keep_alive_types.h" |
14 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 14 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/browser_window_state.h" | 16 #include "chrome/browser/ui/browser_window_state.h" |
17 #include "components/prefs/pref_service.h" | 17 #include "components/prefs/pref_service.h" |
18 #include "components/prefs/scoped_user_pref_update.h" | 18 #include "components/prefs/scoped_user_pref_update.h" |
19 #include "components/version_info/version_info.h" | 19 #include "components/version_info/version_info.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "content/public/browser/context_factory.h" | 21 #include "content/public/browser/context_factory.h" |
| 22 #include "content/public/browser/focused_node_details.h" |
| 23 #include "content/public/browser/notification_details.h" |
| 24 #include "content/public/browser/notification_service.h" |
| 25 #include "content/public/browser/notification_types.h" |
22 #include "grit/chrome_unscaled_resources.h" | 26 #include "grit/chrome_unscaled_resources.h" |
23 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/base/ui_base_switches.h" | 28 #include "ui/base/ui_base_switches.h" |
25 #include "ui/gfx/geometry/rect.h" | 29 #include "ui/gfx/geometry/rect.h" |
26 #include "ui/gfx/screen.h" | 30 #include "ui/gfx/screen.h" |
27 #include "ui/views/controls/menu/menu_controller.h" | 31 #include "ui/views/controls/menu/menu_controller.h" |
28 #include "ui/views/widget/native_widget.h" | 32 #include "ui/views/widget/native_widget.h" |
29 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
30 | 34 |
31 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayMatching(*bounds); | 252 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayMatching(*bounds); |
249 bounds->AdjustToFit(display.work_area()); | 253 bounds->AdjustToFit(display.work_area()); |
250 ash::wm::GetWindowState(window)->set_minimum_visibility(true); | 254 ash::wm::GetWindowState(window)->set_minimum_visibility(true); |
251 #endif | 255 #endif |
252 return true; | 256 return true; |
253 } | 257 } |
254 | 258 |
255 void ChromeViewsDelegate::NotifyAccessibilityEvent( | 259 void ChromeViewsDelegate::NotifyAccessibilityEvent( |
256 views::View* view, ui::AXEvent event_type) { | 260 views::View* view, ui::AXEvent event_type) { |
257 #if defined(USE_AURA) | 261 #if defined(USE_AURA) |
| 262 bool is_editable_node = false; |
| 263 gfx::Rect bounds_in_screen = view->GetBoundsInScreen(); |
| 264 content::FocusedNodeDetails details = {is_editable_node, bounds_in_screen}; |
| 265 content::NotificationService::current()->Notify( |
| 266 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 267 content::Source<views::View>(view), |
| 268 content::Details<content::FocusedNodeDetails>(&details)); |
| 269 |
258 AutomationManagerAura::GetInstance()->HandleEvent( | 270 AutomationManagerAura::GetInstance()->HandleEvent( |
259 GetProfileForWindow(view->GetWidget()), view, event_type); | 271 GetProfileForWindow(view->GetWidget()), view, event_type); |
260 #endif | 272 #endif |
261 } | 273 } |
262 | 274 |
263 views::ViewsDelegate::ProcessMenuAcceleratorResult | 275 views::ViewsDelegate::ProcessMenuAcceleratorResult |
264 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( | 276 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( |
265 const ui::Accelerator& accelerator) { | 277 const ui::Accelerator& accelerator) { |
266 #if defined(USE_ASH) | 278 #if defined(USE_ASH) |
267 ash::AcceleratorController* accelerator_controller = | 279 ash::AcceleratorController* accelerator_controller = |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 return content::BrowserThread::GetBlockingPool(); | 499 return content::BrowserThread::GetBlockingPool(); |
488 } | 500 } |
489 | 501 |
490 #if !defined(USE_ASH) | 502 #if !defined(USE_ASH) |
491 views::Widget::InitParams::WindowOpacity | 503 views::Widget::InitParams::WindowOpacity |
492 ChromeViewsDelegate::GetOpacityForInitParams( | 504 ChromeViewsDelegate::GetOpacityForInitParams( |
493 const views::Widget::InitParams& params) { | 505 const views::Widget::InitParams& params) { |
494 return views::Widget::InitParams::OPAQUE_WINDOW; | 506 return views::Widget::InitParams::OPAQUE_WINDOW; |
495 } | 507 } |
496 #endif | 508 #endif |
OLD | NEW |