| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_view.h" | 10 #include "chrome/browser/ui/views/dropdown_bar_view.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 using gfx::Path; | 36 using gfx::Path; |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 bool DropdownBarHost::disable_animations_during_testing_ = false; | 39 bool DropdownBarHost::disable_animations_during_testing_ = false; |
| 40 | 40 |
| 41 //////////////////////////////////////////////////////////////////////////////// | 41 //////////////////////////////////////////////////////////////////////////////// |
| 42 // DropdownBarHost, public: | 42 // DropdownBarHost, public: |
| 43 | 43 |
| 44 DropdownBarHost::DropdownBarHost(BrowserView* browser_view) | 44 DropdownBarHost::DropdownBarHost(BrowserView* browser_view) |
| 45 : browser_view_(browser_view), | 45 : browser_view_(browser_view), |
| 46 view_(NULL), |
| 46 animation_offset_(0), | 47 animation_offset_(0), |
| 48 focus_manager_(NULL), |
| 47 esc_accel_target_registered_(false), | 49 esc_accel_target_registered_(false), |
| 48 is_visible_(false) { | 50 is_visible_(false) { |
| 49 } | 51 } |
| 50 | 52 |
| 51 void DropdownBarHost::Init(DropdownBarView* view) { | 53 void DropdownBarHost::Init(DropdownBarView* view) { |
| 52 view_ = view; | 54 view_ = view; |
| 53 | 55 |
| 54 // Initialize the host. | 56 // Initialize the host. |
| 55 host_.reset(CreateHost()); | 57 host_.reset(CreateHost()); |
| 56 host_->InitWithWidget(browser_view_->GetWidget(), gfx::Rect()); | 58 host_->InitWithWidget(browser_view_->GetWidget(), gfx::Rect()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 focus_manager_->RegisterAccelerator(escape, this); | 312 focus_manager_->RegisterAccelerator(escape, this); |
| 311 esc_accel_target_registered_ = true; | 313 esc_accel_target_registered_ = true; |
| 312 } | 314 } |
| 313 | 315 |
| 314 void DropdownBarHost::UnregisterAccelerators() { | 316 void DropdownBarHost::UnregisterAccelerators() { |
| 315 DCHECK(esc_accel_target_registered_); | 317 DCHECK(esc_accel_target_registered_); |
| 316 views::Accelerator escape(ui::VKEY_ESCAPE, false, false, false); | 318 views::Accelerator escape(ui::VKEY_ESCAPE, false, false, false); |
| 317 focus_manager_->UnregisterAccelerator(escape, this); | 319 focus_manager_->UnregisterAccelerator(escape, this); |
| 318 esc_accel_target_registered_ = false; | 320 esc_accel_target_registered_ = false; |
| 319 } | 321 } |
| OLD | NEW |