More boring fixups

This commit is contained in:
Paul Betts 2016-03-09 11:27:16 -08:00 committed by Cheng Zhao
parent 1c01e4955f
commit f4ec369873
5 changed files with 7 additions and 8 deletions

View file

@ -102,9 +102,9 @@ int ShowMessageBoxUTF16(HWND parent,
base::win::ScopedHICON hicon; base::win::ScopedHICON hicon;
if (!icon.isNull()) { if (!icon.isNull()) {
hicon.Set(IconUtil::CreateHICONFromSkBitmap(*icon.bitmap())); hicon = IconUtil::CreateHICONFromSkBitmap(*icon.bitmap());
config.dwFlags |= TDF_USE_HICON_MAIN; config.dwFlags |= TDF_USE_HICON_MAIN;
config.hMainIcon = hicon.Get(); config.hMainIcon = hicon.get();
} else { } else {
// Show icon according to dialog's type. // Show icon according to dialog's type.
switch (type) { switch (type) {

View file

@ -91,7 +91,7 @@ bool TaskbarHost::SetThumbarButtons(
if (!button.icon.IsEmpty()) { if (!button.icon.IsEmpty()) {
thumb_button.dwMask |= THB_ICON; thumb_button.dwMask |= THB_ICON;
icons[i] = IconUtil::CreateHICONFromSkBitmap(button.icon.AsBitmap()); icons[i] = IconUtil::CreateHICONFromSkBitmap(button.icon.AsBitmap());
thumb_button.hIcon = icons[i].Get(); thumb_button.hIcon = icons[i].get();
} }
// Set tooltip. // Set tooltip.
@ -139,7 +139,7 @@ bool TaskbarHost::SetOverlayIcon(
base::win::ScopedHICON icon( base::win::ScopedHICON icon(
IconUtil::CreateHICONFromSkBitmap(overlay.AsBitmap())); IconUtil::CreateHICONFromSkBitmap(overlay.AsBitmap()));
return SUCCEEDED( return SUCCEEDED(
taskbar_->SetOverlayIcon(window, icon, base::UTF8ToUTF16(text).c_str())); taskbar_->SetOverlayIcon(window, icon.get(), base::UTF8ToUTF16(text).c_str()));
} }
bool TaskbarHost::HandleThumbarButtonEvent(int button_id) { bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {

View file

@ -158,11 +158,11 @@ bool ReadImageSkiaFromICO(gfx::ImageSkia* image, const base::FilePath& path) {
base::win::ScopedHICON icon(static_cast<HICON>( base::win::ScopedHICON icon(static_cast<HICON>(
LoadImage(NULL, image_path.value().c_str(), IMAGE_ICON, 0, 0, LoadImage(NULL, image_path.value().c_str(), IMAGE_ICON, 0, 0,
LR_DEFAULTSIZE | LR_LOADFROMFILE))); LR_DEFAULTSIZE | LR_LOADFROMFILE)));
if (!icon) if (!icon.get())
return false; return false;
// Convert the icon from the Windows specific HICON to gfx::ImageSkia. // Convert the icon from the Windows specific HICON to gfx::ImageSkia.
scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon)); scoped_ptr<SkBitmap> bitmap(IconUtil:: CreateSkBitmapFromHICON(icon.get()));
image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, 1.0f)); image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, 1.0f));
return true; return true;
} }

View file

@ -86,7 +86,7 @@ bool WriteReportIDToFile(const std::wstring& dump_path,
if (!file.is_open()) if (!file.is_open())
return false; return false;
int64 seconds_since_epoch = int64_t seconds_since_epoch =
(base::Time::Now() - base::Time::UnixEpoch()).InSeconds(); (base::Time::Now() - base::Time::UnixEpoch()).InSeconds();
std::wstring line = base::Int64ToString16(seconds_since_epoch); std::wstring line = base::Int64ToString16(seconds_since_epoch);
line += L','; line += L',';

View file

@ -12,7 +12,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/win/metro.h"
#include "base/win/scoped_co_mem.h" #include "base/win/scoped_co_mem.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"