| 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/dropdown_bar_host.h" | 5 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
| 10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" | 10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" |
| 11 #include "chrome/browser/ui/views/dropdown_bar_view.h" | 11 #include "chrome/browser/ui/views/dropdown_bar_view.h" |
| 12 #include "chrome/browser/ui/views/frame/browser_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 13 #include "ui/base/animation/slide_animation.h" | 13 #include "ui/base/animation/slide_animation.h" |
| 14 #include "ui/base/keycodes/keyboard_codes.h" | 14 #include "ui/base/keycodes/keyboard_codes.h" |
| 15 #include "ui/gfx/path.h" | 15 #include "ui/gfx/path.h" |
| 16 #include "ui/gfx/scrollbar_size.h" | 16 #include "ui/gfx/scrollbar_size.h" |
| 17 #include "ui/views/focus/external_focus_tracker.h" | 17 #include "ui/views/focus/external_focus_tracker.h" |
| 18 #include "ui/views/focus/view_storage.h" | 18 #include "ui/views/focus/view_storage.h" |
| 19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 20 | 20 |
| 21 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
| 22 #include "ui/gfx/scoped_sk_region.h" | 22 #include "ui/gfx/scoped_sk_region.h" |
| 23 #elif defined(OS_WIN) | 23 #elif defined(OS_WIN) |
| 24 #include "base/win/scoped_gdi_object.h" | 24 #include "base/win/scoped_gdi_object.h" |
| 25 #elif defined(TOOLKIT_USES_GTK) | 25 #elif defined(TOOLKIT_USES_GTK) |
| 26 #include "ui/base/gtk/scoped_handle_gtk.h" | 26 #include "ui/base/gtk/scoped_region.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 #if defined(USE_AURA) | 31 #if defined(USE_AURA) |
| 32 typedef gfx::ScopedSkRegion ScopedPlatformRegion; | 32 typedef gfx::ScopedSkRegion ScopedPlatformRegion; |
| 33 #elif defined(OS_WIN) | 33 #elif defined(OS_WIN) |
| 34 typedef base::win::ScopedRegion ScopedPlatformRegion; | 34 typedef base::win::ScopedRegion ScopedPlatformRegion; |
| 35 #elif defined(TOOLKIT_USES_GTK) | 35 #elif defined(TOOLKIT_USES_GTK) |
| 36 typedef ui::ScopedRegion ScopedPlatformRegion; | 36 typedef ui::ScopedRegion ScopedPlatformRegion; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 escape, ui::AcceleratorManager::kNormalPriority, this); | 343 escape, ui::AcceleratorManager::kNormalPriority, this); |
| 344 esc_accel_target_registered_ = true; | 344 esc_accel_target_registered_ = true; |
| 345 } | 345 } |
| 346 | 346 |
| 347 void DropdownBarHost::UnregisterAccelerators() { | 347 void DropdownBarHost::UnregisterAccelerators() { |
| 348 DCHECK(esc_accel_target_registered_); | 348 DCHECK(esc_accel_target_registered_); |
| 349 ui::Accelerator escape(ui::VKEY_ESCAPE, false, false, false); | 349 ui::Accelerator escape(ui::VKEY_ESCAPE, false, false, false); |
| 350 focus_manager_->UnregisterAccelerator(escape, this); | 350 focus_manager_->UnregisterAccelerator(escape, this); |
| 351 esc_accel_target_registered_ = false; | 351 esc_accel_target_registered_ = false; |
| 352 } | 352 } |
| OLD | NEW |