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

Side by Side Diff: chrome/browser/ui/panels/panel_gtk.cc

Issue 10836324: Panels test cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback change to remove redundant if-check Created 8 years, 4 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 | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/panels/panel_gtk.h" 5 #include "chrome/browser/ui/panels/panel_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #include <X11/XF86keysym.h> 9 #include <X11/XF86keysym.h>
10 10
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 gfx::Size new_size(event->width, event->height); 337 gfx::Size new_size(event->width, event->height);
338 if (new_size == configure_size_) 338 if (new_size == configure_size_)
339 return FALSE; 339 return FALSE;
340 340
341 UpdateWindowShape(event->width, event->height); 341 UpdateWindowShape(event->width, event->height);
342 configure_size_ = new_size; 342 configure_size_ = new_size;
343 343
344 if (!GetFrameSize().IsEmpty()) 344 if (!GetFrameSize().IsEmpty())
345 return FALSE; 345 return FALSE;
346 346
347 // Save the frame size allocated by the system after as the 347 // Save the frame size allocated by the system as the
348 // frame size will be affected when we shrink the panel smaller 348 // frame size will be affected when we shrink the panel smaller
349 // than the frame (e.g. when the panel is minimized). 349 // than the frame (e.g. when the panel is minimized).
350 SetFrameSize(GetNonClientFrameSize()); 350 SetFrameSize(GetNonClientFrameSize());
351 panel_->OnWindowSizeAvailable(); 351 panel_->OnWindowSizeAvailable();
352 352
353 content::NotificationService::current()->Notify( 353 content::NotificationService::current()->Notify(
354 chrome::NOTIFICATION_PANEL_WINDOW_SIZE_KNOWN, 354 chrome::NOTIFICATION_PANEL_WINDOW_SIZE_KNOWN,
355 content::Source<Panel>(panel_.get()), 355 content::Source<Panel>(panel_.get()),
356 content::NotificationService::NoDetails()); 356 content::NotificationService::NoDetails());
357 357
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 758
759 void PanelGtk::SetPanelBoundsInstantly(const gfx::Rect& bounds) { 759 void PanelGtk::SetPanelBoundsInstantly(const gfx::Rect& bounds) {
760 SetBoundsInternal(bounds, false); 760 SetBoundsInternal(bounds, false);
761 } 761 }
762 762
763 void PanelGtk::SetBoundsInternal(const gfx::Rect& bounds, bool animate) { 763 void PanelGtk::SetBoundsInternal(const gfx::Rect& bounds, bool animate) {
764 if (bounds == bounds_) 764 if (bounds == bounds_)
765 return; 765 return;
766 766
767 if (!animate) { 767 if (is_shown_) {
768 // If no animation is in progress, apply bounds change instantly. Otherwise, 768 if (!animate) {
769 // continue the animation with new target bounds. 769 // If no animation is in progress, apply bounds change instantly.
770 if (!IsAnimatingBounds()) 770 // Otherwise, continue the animation with new target bounds.
771 gdk_window_move_resize(gtk_widget_get_window(GTK_WIDGET(window_)), 771 if (!IsAnimatingBounds())
772 bounds.x(), bounds.y(), 772 gdk_window_move_resize(gtk_widget_get_window(GTK_WIDGET(window_)),
773 bounds.width(), bounds.height()); 773 bounds.x(), bounds.y(),
774 } else if (is_shown_) { 774 bounds.width(), bounds.height());
775 StartBoundsAnimation(bounds_, bounds); 775 } else {
776 StartBoundsAnimation(bounds_, bounds);
777 }
776 } 778 }
777 779
778 bounds_ = bounds; 780 bounds_ = bounds;
779 } 781 }
780 782
781 void PanelGtk::ClosePanel() { 783 void PanelGtk::ClosePanel() {
782 // We're already closing. Do nothing. 784 // We're already closing. Do nothing.
783 if (!window_) 785 if (!window_)
784 return; 786 return;
785 787
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 break; 1184 break;
1183 case panel::RESTORE_BUTTON: 1185 case panel::RESTORE_BUTTON:
1184 button = titlebar->restore_button(); 1186 button = titlebar->restore_button();
1185 break; 1187 break;
1186 default: 1188 default:
1187 NOTREACHED(); 1189 NOTREACHED();
1188 return false; 1190 return false;
1189 } 1191 }
1190 return gtk_widget_get_visible(button->widget()); 1192 return gtk_widget_get_visible(button->widget());
1191 } 1193 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698