summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/dropdown_bar_host.cc
diff options
context:
space:
mode:
authorbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 19:58:08 +0000
committerbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 19:58:08 +0000
commit997d2ddf7d799efc127fd47eb25838cf0d6305ab (patch)
treeb90b21205b64765bf0cdf8fcbfa4ac1d5e430acd /chrome/browser/ui/views/dropdown_bar_host.cc
parente0995e69127ccd887e80434e6b3aec4bedfa0fd4 (diff)
downloadchromium_src-997d2ddf7d799efc127fd47eb25838cf0d6305ab.zip
chromium_src-997d2ddf7d799efc127fd47eb25838cf0d6305ab.tar.gz
chromium_src-997d2ddf7d799efc127fd47eb25838cf0d6305ab.tar.bz2
Revert 84831 - The initial prototype code for the compact navigation (cnav) prototype, currently only active in windows. This is well hidden behind a flag and a context menu option.
Loosely based off oshima's original prototype patch: http://codereview.chromium.org/165272 BUG=None TEST=Activate the cnav prototype in about:flags. Right click a tab and select "Hide Toolbar" to go into cnav mode. Ensure that the compact location bar provides the same basic functionality as the toolbar (except browser actions). Review URL: http://codereview.chromium.org/6913026 TBR=stevet@chromium.org Review URL: http://codereview.chromium.org/7005004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/dropdown_bar_host.cc')
-rw-r--r--chrome/browser/ui/views/dropdown_bar_host.cc33
1 files changed, 8 insertions, 25 deletions
diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc
index 9675589..875e8a4 100644
--- a/chrome/browser/ui/views/dropdown_bar_host.cc
+++ b/chrome/browser/ui/views/dropdown_bar_host.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include "chrome/browser/ui/view_ids.h"
-#include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
#include "chrome/browser/ui/views/dropdown_bar_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "ui/base/animation/slide_animation.h"
@@ -45,20 +44,14 @@ bool DropdownBarHost::disable_animations_during_testing_ = false;
DropdownBarHost::DropdownBarHost(BrowserView* browser_view)
: browser_view_(browser_view),
view_(NULL),
- delegate_(NULL),
animation_offset_(0),
focus_manager_(NULL),
esc_accel_target_registered_(false),
is_visible_(false) {
}
-void DropdownBarHost::Init(views::View* view,
- DropdownBarHostDelegate* delegate) {
- DCHECK(view);
- DCHECK(delegate);
-
+void DropdownBarHost::Init(DropdownBarView* view) {
view_ = view;
- delegate_ = delegate;
// Initialize the host.
host_.reset(views::Widget::CreateWidget());
@@ -109,7 +102,7 @@ void DropdownBarHost::Show(bool animate) {
}
void DropdownBarHost::SetFocusAndSelection() {
- delegate_->SetFocusAndSelection(true);
+ view_->SetFocusAndSelection(true);
}
bool DropdownBarHost::IsAnimating() const {
@@ -119,23 +112,13 @@ bool DropdownBarHost::IsAnimating() const {
void DropdownBarHost::Hide(bool animate) {
if (!IsVisible())
return;
- if (animate && !disable_animations_during_testing_ &&
- !animation_->IsClosing()) {
+ if (animate && !disable_animations_during_testing_) {
+ animation_->Reset(1.0);
animation_->Hide();
} else {
- if (animation_->IsClosing()) {
- // If we're in the middle of a close animation, skip immediately to the
- // end of the animation.
- StopAnimation();
- } else {
- // Otherwise we need to set both the animation state to ended and the
- // DropdownBarHost state to ended/hidden, otherwise the next time we try
- // to show the bar, it might refuse to do so. Note that we call
- // AnimationEnded ourselves as Reset does not call it if we are not
- // animating here.
- animation_->Reset();
- AnimationEnded(animation_.get());
- }
+ StopAnimation();
+ is_visible_ = false;
+ host_->Hide();
}
}
@@ -188,7 +171,7 @@ void DropdownBarHost::AnimationProgressed(const ui::Animation* animation) {
// Let the view know if we are animating, and at which offset to draw the
// edges.
- delegate_->SetAnimationOffset(animation_offset_);
+ view_->set_animation_offset(animation_offset_);
view_->SchedulePaint();
}