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

Unified Diff: chrome/browser/views/infobars/infobars.cc

Issue 2873029: Fix a crasher with the translate infobar.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/infobars/infobars.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/infobars/infobars.cc
===================================================================
--- chrome/browser/views/infobars/infobars.cc (revision 51005)
+++ chrome/browser/views/infobars/infobars.cc (working copy)
@@ -142,43 +142,6 @@
InfoBar::~InfoBar() {
}
-void InfoBar::AnimateOpen() {
- animation_->Show();
-}
-
-void InfoBar::Open() {
- // Set the animation value to 1.0 so that GetPreferredSize() returns the right
- // size.
- animation_->Reset(1.0);
- if (container_)
- container_->InfoBarAnimated(false);
-}
-
-void InfoBar::AnimateClose() {
- bool restore_focus = true;
-#if defined(OS_WIN)
- // Do not restore focus (and active state with it) on Windows if some other
- // top-level window became active.
- if (GetWidget() &&
- !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) {
- restore_focus = false;
- }
-#endif // defined(OS_WIN)
- DestroyFocusTracker(restore_focus);
- animation_->Hide();
-}
-
-void InfoBar::Close() {
- GetParent()->RemoveChildView(this);
- // Note that we only tell the delegate we're closed here, and not when we're
- // simply destroyed (by virtue of a tab switch or being moved from window to
- // window), since this action can cause the delegate to destroy itself.
- if (delegate_) {
- delegate_->InfoBarClosed();
- delegate_ = NULL;
- }
-}
-
// InfoBar, views::View overrides: ---------------------------------------------
bool InfoBar::GetAccessibleRole(AccessibilityTypes::Role* role) {
@@ -260,6 +223,43 @@
// InfoBar, private: -----------------------------------------------------------
+void InfoBar::AnimateOpen() {
+ animation_->Show();
+}
+
+void InfoBar::Open() {
+ // Set the animation value to 1.0 so that GetPreferredSize() returns the right
+ // size.
+ animation_->Reset(1.0);
+ if (container_)
+ container_->InfoBarAnimated(false);
+}
+
+void InfoBar::AnimateClose() {
+ bool restore_focus = true;
+#if defined(OS_WIN)
+ // Do not restore focus (and active state with it) on Windows if some other
+ // top-level window became active.
+ if (GetWidget() &&
+ !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) {
+ restore_focus = false;
+ }
+#endif // defined(OS_WIN)
+ DestroyFocusTracker(restore_focus);
+ animation_->Hide();
+}
+
+void InfoBar::Close() {
+ GetParent()->RemoveChildView(this);
+ // Note that we only tell the delegate we're closed here, and not when we're
+ // simply destroyed (by virtue of a tab switch or being moved from window to
+ // window), since this action can cause the delegate to destroy itself.
+ if (delegate_) {
+ delegate_->InfoBarClosed();
+ delegate_ = NULL;
+ }
+}
+
void InfoBar::InfoBarAdded() {
// The container_ pointer must be set before adding to the view hierarchy.
DCHECK(container_);
« no previous file with comments | « chrome/browser/views/infobars/infobars.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698