Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: chrome/browser/views/infobars/infobars.cc

Issue 2602003: Refactored the translate infobars. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Synced Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/infobars/infobars.h" 5 #include "chrome/browser/views/infobars/infobars.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "app/slide_animation.h" 9 #include "app/slide_animation.h"
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 InfoBar::~InfoBar() { 142 InfoBar::~InfoBar() {
143 } 143 }
144 144
145 void InfoBar::AnimateOpen() { 145 void InfoBar::AnimateOpen() {
146 animation_->Show(); 146 animation_->Show();
147 } 147 }
148 148
149 void InfoBar::Open() { 149 void InfoBar::Open() {
150 // Set the animation value to 1.0 so that GetPreferredSize() returns the right
151 // size.
150 animation_->Reset(1.0); 152 animation_->Reset(1.0);
151 animation_->Show(); 153 if (container_)
154 container_->InfoBarAnimated(false);
152 } 155 }
153 156
154 void InfoBar::AnimateClose() { 157 void InfoBar::AnimateClose() {
155 bool restore_focus = true; 158 bool restore_focus = true;
156 #if defined(OS_WIN) 159 #if defined(OS_WIN)
157 // Do not restore focus (and active state with it) on Windows if some other 160 // Do not restore focus (and active state with it) on Windows if some other
158 // top-level window became active. 161 // top-level window became active.
159 if (GetWidget() && 162 if (GetWidget() &&
160 !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) { 163 !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) {
161 restore_focus = false; 164 restore_focus = false;
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 594
592 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { 595 InfoBar* LinkInfoBarDelegate::CreateInfoBar() {
593 return new LinkInfoBar(this); 596 return new LinkInfoBar(this);
594 } 597 }
595 598
596 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- 599 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: --------------------------
597 600
598 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { 601 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() {
599 return new ConfirmInfoBar(this); 602 return new ConfirmInfoBar(this);
600 } 603 }
OLDNEW
« no previous file with comments | « chrome/browser/views/infobars/infobar_text_button.cc ('k') | chrome/browser/views/infobars/translate_infobar_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698