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

Unified Diff: chrome/browser/views/frame/glass_browser_frame_view.cc

Issue 660410: Fix issue 29996 (Closed)
Patch Set: get reset icon on StopThrobber per brettw Created 10 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/glass_browser_frame_view.cc
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc
index a2d219b99e1fa26deb691fbd5f27c907aba7a393..cee0407843ccecffea6808e42f2a912caba88b8d 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/views/frame/glass_browser_frame_view.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/views/frame/glass_browser_frame_view.h"
#include "app/gfx/canvas.h"
+#include "app/gfx/icon_util.h"
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -411,10 +412,27 @@ void GlassBrowserFrameView::StopThrobber() {
if (throbber_running_) {
throbber_running_ = false;
+ HICON frame_icon = NULL;
+
+ // Check if hosted BrowserView has a window icon to use.
+ if (browser_view_->ShouldShowWindowIcon()) {
+ SkBitmap icon = browser_view_->GetWindowIcon();
+ if (!icon.isNull())
+ frame_icon = IconUtil::CreateHICONFromSkBitmap(icon);
+ }
+
+ // Fallback to class icon.
+ if (!frame_icon) {
+ frame_icon = reinterpret_cast<HICON>(GetClassLongPtr(
+ frame_->GetWindow()->GetNativeWindow(), GCLP_HICONSM));
+ }
+
// This will reset the small icon which we set in the throbber code.
- // Windows will then pick up the default icon from the window class.
+ // WM_SETICON with NULL icon restores the icon for title bar but not
+ // for taskbar. See http://crbug.com/29996
SendMessage(frame_->GetWindow()->GetNativeWindow(), WM_SETICON,
- static_cast<WPARAM>(ICON_SMALL), NULL);
+ static_cast<WPARAM>(ICON_SMALL),
+ reinterpret_cast<LPARAM>(frame_icon));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698