@@ -475,52 +475,50 @@ void NativeWindowWin::FlashFrame(bool flash) {
475
475
}
476
476
477
477
HICON createBadgeIcon (const HWND hWnd, const TCHAR *value, const int sizeX, const int sizeY) {
478
- // canvas for the overlay icon
479
- gfx::Canvas canvas (gfx::Size (sizeX, sizeY), 1 , false );
478
+ // canvas for the overlay icon
479
+ gfx::Canvas canvas (gfx::Size (sizeX, sizeY), 1 , false );
480
480
481
- // drawing red circle
482
- SkPaint paint;
483
- paint.setColor (SK_ColorRED);
484
- canvas.DrawCircle (gfx::Point (sizeX/ 2 , sizeY/ 2 ), sizeX/ 2 , paint);
481
+ // drawing red circle
482
+ SkPaint paint;
483
+ paint.setColor (SK_ColorRED);
484
+ canvas.DrawCircle (gfx::Point (sizeX / 2 , sizeY / 2 ), sizeX / 2 , paint);
485
485
486
- // drawing the text
487
- gfx::PlatformFont *platform_font = gfx::PlatformFont::CreateDefault ();
488
- const int fontSize = sizeY*0 .65f ;
489
- gfx::Font font (platform_font->GetFontName (), fontSize);
490
- platform_font->Release ();
491
- platform_font = NULL ;
492
- const int yMargin = (sizeY - fontSize) / 2 ;
493
- canvas.DrawStringRectWithFlags (value, gfx::FontList (font), SK_ColorWHITE, gfx::Rect (sizeX, fontSize+ yMargin+ 1 ), gfx::Canvas::TEXT_ALIGN_CENTER);
486
+ // drawing the text
487
+ gfx::PlatformFont *platform_font = gfx::PlatformFont::CreateDefault ();
488
+ const int fontSize = sizeY*0 .65f ;
489
+ gfx::Font font (platform_font->GetFontName (), fontSize);
490
+ platform_font->Release ();
491
+ platform_font = NULL ;
492
+ const int yMargin = (sizeY - fontSize) / 2 ;
493
+ canvas.DrawStringRectWithFlags (value, gfx::FontList (font), SK_ColorWHITE, gfx::Rect (sizeX, fontSize + yMargin + 1 ), gfx::Canvas::TEXT_ALIGN_CENTER);
494
494
495
- // return the canvas as windows native icon handle
496
- return IconUtil::CreateHICONFromSkBitmap (canvas.ExtractImageRep ().sk_bitmap ());
495
+ // return the canvas as windows native icon handle
496
+ return IconUtil::CreateHICONFromSkBitmap (canvas.ExtractImageRep ().sk_bitmap ());
497
497
}
498
498
499
499
void NativeWindowWin::SetBadgeLabel (const std::string& badge) {
500
- base::win::ScopedComPtr<ITaskbarList3> taskbar;
501
- HRESULT result = taskbar.CreateInstance (CLSID_TaskbarList, NULL ,
502
- CLSCTX_INPROC_SERVER);
503
-
504
- if (FAILED (result)) {
505
- VLOG (1 ) << " Failed creating a TaskbarList3 object: " << result;
506
- return ;
507
- }
508
-
509
- result = taskbar->HrInit ();
510
- if (FAILED (result)) {
511
- LOG (ERROR) << " Failed initializing an ITaskbarList3 interface." ;
512
- return ;
513
- }
514
-
515
- HICON icon = NULL ;
516
- HWND hWnd = window_->GetNativeWindow ();
517
- if (badge.size ())
518
- icon = createBadgeIcon (hWnd, UTF8ToUTF16 (badge).c_str (), 32 , 32 );
519
-
520
- taskbar->SetOverlayIcon (hWnd, icon, _T (" Status" ));
521
- DestroyIcon (icon);
500
+ base::win::ScopedComPtr<ITaskbarList3> taskbar;
501
+ HRESULT result = taskbar.CreateInstance (CLSID_TaskbarList, NULL ,
502
+ CLSCTX_INPROC_SERVER);
503
+
504
+ if (FAILED (result)) {
505
+ VLOG (1 ) << " Failed creating a TaskbarList3 object: " << result;
506
+ return ;
507
+ }
508
+
509
+ result = taskbar->HrInit ();
510
+ if (FAILED (result)) {
511
+ LOG (ERROR) << " Failed initializing an ITaskbarList3 interface." ;
512
+ return ;
513
+ }
522
514
515
+ HICON icon = NULL ;
516
+ HWND hWnd = window_->GetNativeWindow ();
517
+ if (badge.size ())
518
+ icon = createBadgeIcon (hWnd, UTF8ToUTF16 (badge).c_str (), 32 , 32 );
523
519
520
+ taskbar->SetOverlayIcon (hWnd, icon, _T (" Status" ));
521
+ DestroyIcon (icon);
524
522
}
525
523
526
524
void NativeWindowWin::SetKiosk (bool kiosk) {
0 commit comments