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

Unified Diff: chrome/browser/icon_loader_win.cc

Issue 113120: stub impl of linux,mac icon loader/manager (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: style fixes Created 11 years, 7 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/icon_loader_win.h ('k') | chrome/browser/icon_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_win.cc
===================================================================
--- chrome/browser/icon_loader_win.cc (revision 15577)
+++ chrome/browser/icon_loader_win.cc (working copy)
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/icon_loader_win.h"
+#include "chrome/browser/icon_loader.h"
#include <windows.h>
#include <shellapi.h>
@@ -11,34 +11,8 @@
#include "base/gfx/size.h"
#include "base/message_loop.h"
#include "base/thread.h"
-#include "chrome/browser/browser_process.h"
-#include "skia/include/SkBitmap.h"
-IconLoader* IconLoader::Create(const FilePath& path, IconSize size,
- Delegate* delegate) {
- return new IconLoaderWin(path, size, delegate);
-}
-
-IconLoaderWin::IconLoaderWin(const FilePath& path, IconSize size,
- Delegate* delegate)
- : path_(path),
- icon_size_(size),
- bitmap_(NULL),
- delegate_(delegate) {
-}
-
-IconLoaderWin::~IconLoaderWin() {
- delete bitmap_;
-}
-
-void IconLoaderWin::Start() {
- target_message_loop_ = MessageLoop::current();
-
- g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &IconLoaderWin::ReadIcon));
-}
-
-void IconLoaderWin::ReadIcon() {
+void IconLoader::ReadIcon() {
int size = 0;
switch (icon_size_) {
case IconLoader::SMALL:
@@ -54,7 +28,7 @@
NOTREACHED();
}
SHFILEINFO file_info = { 0 };
- if (!SHGetFileInfo(path_.value().c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
+ if (!SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
sizeof(SHFILEINFO),
SHGFI_ICON | size | SHGFI_USEFILEATTRIBUTES))
return;
@@ -71,10 +45,5 @@
bitmap_ = IconUtil::CreateSkBitmapFromHICON(file_info.hIcon, icon_size);
target_message_loop_->PostTask(FROM_HERE,
- NewRunnableMethod(this, &IconLoaderWin::NotifyDelegate));
+ NewRunnableMethod(this, &IconLoader::NotifyDelegate));
}
-
-void IconLoaderWin::NotifyDelegate() {
- delegate_->OnBitmapLoaded(this, bitmap_);
- bitmap_ = NULL;
-}
« no previous file with comments | « chrome/browser/icon_loader_win.h ('k') | chrome/browser/icon_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698