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

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

Issue 10987037: Add tests for panel app icon functionaility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 8 years, 2 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/cocoa/panels/panel_cocoa.mm ('k') | chrome/browser/ui/panels/native_panel.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) 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/gtk/panels/panel_gtk.h" 5 #include "chrome/browser/ui/gtk/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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 private: 1021 private:
1022 virtual void PressLeftMouseButtonTitlebar( 1022 virtual void PressLeftMouseButtonTitlebar(
1023 const gfx::Point& mouse_location, panel::ClickModifier modifier) OVERRIDE; 1023 const gfx::Point& mouse_location, panel::ClickModifier modifier) OVERRIDE;
1024 virtual void ReleaseMouseButtonTitlebar( 1024 virtual void ReleaseMouseButtonTitlebar(
1025 panel::ClickModifier modifier) OVERRIDE; 1025 panel::ClickModifier modifier) OVERRIDE;
1026 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; 1026 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE;
1027 virtual void CancelDragTitlebar() OVERRIDE; 1027 virtual void CancelDragTitlebar() OVERRIDE;
1028 virtual void FinishDragTitlebar() OVERRIDE; 1028 virtual void FinishDragTitlebar() OVERRIDE;
1029 virtual bool VerifyDrawingAttention() const OVERRIDE; 1029 virtual bool VerifyDrawingAttention() const OVERRIDE;
1030 virtual bool VerifyActiveState(bool is_active) OVERRIDE; 1030 virtual bool VerifyActiveState(bool is_active) OVERRIDE;
1031 virtual bool VerifyAppIcon() const OVERRIDE;
1031 virtual void WaitForWindowCreationToComplete() const OVERRIDE; 1032 virtual void WaitForWindowCreationToComplete() const OVERRIDE;
1032 virtual bool IsWindowSizeKnown() const OVERRIDE; 1033 virtual bool IsWindowSizeKnown() const OVERRIDE;
1033 virtual bool IsAnimatingBounds() const OVERRIDE; 1034 virtual bool IsAnimatingBounds() const OVERRIDE;
1034 virtual bool IsButtonVisible( 1035 virtual bool IsButtonVisible(
1035 panel::TitlebarButtonType button_type) const OVERRIDE; 1036 panel::TitlebarButtonType button_type) const OVERRIDE;
1036 1037
1037 PanelGtk* panel_gtk_; 1038 PanelGtk* panel_gtk_;
1038 }; 1039 };
1039 1040
1040 NativePanelTesting* PanelGtk::CreateNativePanelTesting() { 1041 NativePanelTesting* PanelGtk::CreateNativePanelTesting() {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1105
1105 bool GtkNativePanelTesting::VerifyDrawingAttention() const { 1106 bool GtkNativePanelTesting::VerifyDrawingAttention() const {
1106 return panel_gtk_->IsDrawingAttention(); 1107 return panel_gtk_->IsDrawingAttention();
1107 } 1108 }
1108 1109
1109 bool GtkNativePanelTesting::VerifyActiveState(bool is_active) { 1110 bool GtkNativePanelTesting::VerifyActiveState(bool is_active) {
1110 // TODO(jianli): to be implemented. http://crbug.com/102737 1111 // TODO(jianli): to be implemented. http://crbug.com/102737
1111 return false; 1112 return false;
1112 } 1113 }
1113 1114
1115 bool GtkNativePanelTesting::VerifyAppIcon() const {
1116 GdkPixbuf* icon = gtk_window_get_icon(panel_gtk_->GetNativePanelHandle());
1117 return icon &&
1118 gdk_pixbuf_get_width(icon) == panel::kPanelAppIconSize &&
1119 gdk_pixbuf_get_height(icon) == panel::kPanelAppIconSize;
1120 }
1121
1114 void GtkNativePanelTesting::WaitForWindowCreationToComplete() const { 1122 void GtkNativePanelTesting::WaitForWindowCreationToComplete() const {
1115 while (GetFrameSize().IsEmpty()) 1123 while (GetFrameSize().IsEmpty())
1116 MessageLoopForUI::current()->RunAllPending(); 1124 MessageLoopForUI::current()->RunAllPending();
1117 } 1125 }
1118 1126
1119 bool GtkNativePanelTesting::IsWindowSizeKnown() const { 1127 bool GtkNativePanelTesting::IsWindowSizeKnown() const {
1120 return !GetFrameSize().IsEmpty(); 1128 return !GetFrameSize().IsEmpty();
1121 } 1129 }
1122 1130
1123 bool GtkNativePanelTesting::IsAnimatingBounds() const { 1131 bool GtkNativePanelTesting::IsAnimatingBounds() const {
(...skipping 13 matching lines...) Expand all
1137 break; 1145 break;
1138 case panel::RESTORE_BUTTON: 1146 case panel::RESTORE_BUTTON:
1139 button = titlebar->restore_button(); 1147 button = titlebar->restore_button();
1140 break; 1148 break;
1141 default: 1149 default:
1142 NOTREACHED(); 1150 NOTREACHED();
1143 return false; 1151 return false;
1144 } 1152 }
1145 return gtk_widget_get_visible(button->widget()); 1153 return gtk_widget_get_visible(button->widget());
1146 } 1154 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/panels/panel_cocoa.mm ('k') | chrome/browser/ui/panels/native_panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698