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

Unified Diff: chrome/browser/ui/views/panels/panel_view.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel_extension_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/panels/panel_view.cc
diff --git a/chrome/browser/ui/views/panels/panel_view.cc b/chrome/browser/ui/views/panels/panel_view.cc
index e64873d9a5fb88af872ef67ee75b0760d5ecc1bc..c7fd8b4bf83bfc15d5a92bdc2cd9149b25fe2f96 100644
--- a/chrome/browser/ui/views/panels/panel_view.cc
+++ b/chrome/browser/ui/views/panels/panel_view.cc
@@ -24,10 +24,11 @@
#include "ui/views/widget/widget.h"
#if defined(OS_WIN) && !defined(USE_ASH) && !defined(USE_AURA)
-#include "ui/base/win/shell.h"
#include "base/win/windows_version.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/ui/panels/taskbar_window_thumbnailer_win.h"
+#include "ui/base/win/shell.h"
+#include "ui/gfx/icon_util.h"
#endif
namespace {
@@ -90,6 +91,7 @@ class NativePanelTestingWin : public NativePanelTesting {
virtual void FinishDragTitlebar() OVERRIDE;
virtual bool VerifyDrawingAttention() const OVERRIDE;
virtual bool VerifyActiveState(bool is_active) OVERRIDE;
+ virtual bool VerifyAppIcon() const OVERRIDE;
virtual bool IsWindowSizeKnown() const OVERRIDE;
virtual bool IsAnimatingBounds() const OVERRIDE;
virtual bool IsButtonVisible(
@@ -135,6 +137,26 @@ bool NativePanelTestingWin::VerifyActiveState(bool is_active) {
: PanelFrameView::PAINT_AS_INACTIVE);
}
+bool NativePanelTestingWin::VerifyAppIcon() const {
+#if defined(OS_WIN) && !defined(USE_AURA)
+ // We only care about Windows 7 and later.
+ if (base::win::GetVersion() < base::win::VERSION_WIN7)
+ return true;
+
+ HWND native_window = panel_view_->GetNativePanelHandle();
+ HICON app_icon = reinterpret_cast<HICON>(
+ ::SendMessage(native_window, WM_GETICON, ICON_BIG, 0L));
+ if (!app_icon)
+ return false;
+ scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(app_icon));
+ return bitmap.get() &&
+ bitmap->width() == panel::kPanelAppIconSize &&
+ bitmap->height() == panel::kPanelAppIconSize;
+#else
+ return true;
+#endif
+}
+
bool NativePanelTestingWin::IsWindowSizeKnown() const {
return true;
}
« no previous file with comments | « chrome/browser/ui/panels/panel_extension_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698