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

Side by Side Diff: chrome/browser/ui/gtk/infobars/infobar_container_gtk.cc

Issue 6932002: gtk/infobars: Refactor AnimateOpen/Open into a single Show() method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/infobars/infobar_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/gtk/infobars/infobar_container_gtk.h" 5 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 g_list_free(children); 175 g_list_free(children);
176 } 176 }
177 177
178 void InfoBarContainerGtk::AddInfoBar(InfoBarDelegate* delegate, bool animate) { 178 void InfoBarContainerGtk::AddInfoBar(InfoBarDelegate* delegate, bool animate) {
179 InfoBar* infobar = delegate->CreateInfoBar(); 179 InfoBar* infobar = delegate->CreateInfoBar();
180 infobar->set_container(this); 180 infobar->set_container(this);
181 infobar->SetThemeProvider(GtkThemeService::GetFrom(profile_)); 181 infobar->SetThemeProvider(GtkThemeService::GetFrom(profile_));
182 gtk_box_pack_start(GTK_BOX(widget()), infobar->widget(), 182 gtk_box_pack_start(GTK_BOX(widget()), infobar->widget(),
183 FALSE, FALSE, 0); 183 FALSE, FALSE, 0);
184 184
185 if (animate) 185 infobar->Show(animate);
186 infobar->AnimateOpen();
187 else
188 infobar->Open();
189
190 ShowArrowForDelegate(delegate, animate); 186 ShowArrowForDelegate(delegate, animate);
191 } 187 }
192 188
193 void InfoBarContainerGtk::RemoveInfoBar(InfoBarDelegate* delegate, 189 void InfoBarContainerGtk::RemoveInfoBar(InfoBarDelegate* delegate,
194 bool animate) { 190 bool animate) {
195 if (animate) { 191 if (animate) {
196 gtk_container_foreach(GTK_CONTAINER(widget()), 192 gtk_container_foreach(GTK_CONTAINER(widget()),
197 AnimateClosingForDelegate, delegate); 193 AnimateClosingForDelegate, delegate);
198 } else { 194 } else {
199 gtk_container_foreach(GTK_CONTAINER(widget()), ClosingForDelegate, 195 gtk_container_foreach(GTK_CONTAINER(widget()), ClosingForDelegate,
(...skipping 12 matching lines...) Expand all
212 } 208 }
213 209
214 void InfoBarContainerGtk::UpdateToolbarInfoBarState(InfoBar* infobar, 210 void InfoBarContainerGtk::UpdateToolbarInfoBarState(InfoBar* infobar,
215 bool animate) { 211 bool animate) {
216 GtkWindow* parent = platform_util::GetTopLevel(widget()); 212 GtkWindow* parent = platform_util::GetTopLevel(widget());
217 BrowserWindowGtk* browser_window = 213 BrowserWindowGtk* browser_window =
218 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); 214 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent);
219 if (browser_window) 215 if (browser_window)
220 browser_window->SetInfoBarShowing(infobar, animate); 216 browser_window->SetInfoBarShowing(infobar, animate);
221 } 217 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/infobars/infobar_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698