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

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: Fix builds Created 8 years, 3 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
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..770b7950e1bd369b688b7557f96953bd01c79bdb 100644
--- a/chrome/browser/ui/views/panels/panel_view.cc
+++ b/chrome/browser/ui/views/panels/panel_view.cc
@@ -7,6 +7,7 @@
#include <map>
#include "base/logging.h"
#include "base/utf_string_conversions.h"
+#include "base/win/windows_version.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/panels/panel.h"
@@ -24,10 +25,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 +92,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 +138,24 @@ bool NativePanelTestingWin::VerifyActiveState(bool is_active) {
: PanelFrameView::PAINT_AS_INACTIVE);
}
+bool NativePanelTestingWin::VerifyAppIcon() const {
+#if defined(OS_WIN) && !defined(USE_AURA)
jennb 2012/10/02 17:51:08 Should this be USE_ASH? Aura is the hw accelerate
jianli 2012/10/02 21:37:26 This should be USE_AURA since there could be a bui
+ // 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() == 32 && bitmap->height() == 32;
+#else
+ return true;
+#endif
+}
+
bool NativePanelTestingWin::IsWindowSizeKnown() const {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698