| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/dropdown_bar_host.h" | 5 #include "chrome/browser/views/dropdown_bar_host.h" |
| 6 | 6 |
| 7 #include "app/slide_animation.h" | 7 #include "app/slide_animation.h" |
| 8 #include "base/keyboard_codes.h" | 8 #include "base/keyboard_codes.h" |
| 9 #include "base/scoped_handle.h" | 9 #include "base/scoped_handle.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 if (!animation_->IsShowing()) { | 168 if (!animation_->IsShowing()) { |
| 169 // Animation has finished closing. | 169 // Animation has finished closing. |
| 170 host_->Hide(); | 170 host_->Hide(); |
| 171 is_visible_ = false; | 171 is_visible_ = false; |
| 172 } else { | 172 } else { |
| 173 // Animation has finished opening. | 173 // Animation has finished opening. |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 void DropdownBarHost::GetThemePosition(gfx::Rect* bounds) { | |
| 178 *bounds = GetDialogPosition(gfx::Rect()); | |
| 179 gfx::Rect toolbar_bounds = browser_view_->GetToolbarBounds(); | |
| 180 gfx::Rect tab_strip_bounds = browser_view_->GetTabStripBounds(); | |
| 181 bounds->Offset(-toolbar_bounds.x(), -tab_strip_bounds.y()); | |
| 182 } | |
| 183 | |
| 184 //////////////////////////////////////////////////////////////////////////////// | 177 //////////////////////////////////////////////////////////////////////////////// |
| 185 // DropdownBarHost protected: | 178 // DropdownBarHost protected: |
| 186 | 179 |
| 187 void DropdownBarHost::ResetFocusTracker() { | 180 void DropdownBarHost::ResetFocusTracker() { |
| 188 focus_tracker_.reset(NULL); | 181 focus_tracker_.reset(NULL); |
| 189 } | 182 } |
| 190 | 183 |
| 191 void DropdownBarHost::GetWidgetBounds(gfx::Rect* bounds) { | 184 void DropdownBarHost::GetWidgetBounds(gfx::Rect* bounds) { |
| 192 DCHECK(bounds); | 185 DCHECK(bounds); |
| 193 *bounds = browser_view_->bounds(); | 186 *bounds = browser_view_->bounds(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 focus_manager_->RegisterAccelerator(escape, this); | 301 focus_manager_->RegisterAccelerator(escape, this); |
| 309 esc_accel_target_registered_ = true; | 302 esc_accel_target_registered_ = true; |
| 310 } | 303 } |
| 311 | 304 |
| 312 void DropdownBarHost::UnregisterAccelerators() { | 305 void DropdownBarHost::UnregisterAccelerators() { |
| 313 DCHECK(esc_accel_target_registered_); | 306 DCHECK(esc_accel_target_registered_); |
| 314 views::Accelerator escape(base::VKEY_ESCAPE, false, false, false); | 307 views::Accelerator escape(base::VKEY_ESCAPE, false, false, false); |
| 315 focus_manager_->UnregisterAccelerator(escape, this); | 308 focus_manager_->UnregisterAccelerator(escape, this); |
| 316 esc_accel_target_registered_ = false; | 309 esc_accel_target_registered_ = false; |
| 317 } | 310 } |
| OLD | NEW |