| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/task_manager/browser_process_resource_provider.h" | 5 #include "chrome/browser/task_manager/browser_process_resource_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "chrome/browser/task_manager/resource_provider.h" | 9 #include "chrome/browser/task_manager/resource_provider.h" |
| 10 #include "chrome/browser/task_manager/task_manager.h" | 10 #include "chrome/browser/task_manager/task_manager.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 BrowserProcessResource::BrowserProcessResource() | 33 BrowserProcessResource::BrowserProcessResource() |
| 34 : title_() { | 34 : title_() { |
| 35 int pid = base::GetCurrentProcId(); | 35 int pid = base::GetCurrentProcId(); |
| 36 bool success = base::OpenPrivilegedProcessHandle(pid, &process_); | 36 bool success = base::OpenPrivilegedProcessHandle(pid, &process_); |
| 37 DCHECK(success); | 37 DCHECK(success); |
| 38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 39 if (!default_icon_) { | 39 if (!default_icon_) { |
| 40 HICON icon = GetAppIcon(); | 40 HICON icon = GetAppIcon(); |
| 41 if (icon) { | 41 if (icon) { |
| 42 scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon)); | 42 scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon)); |
| 43 default_icon_ = new gfx::ImageSkia( | 43 default_icon_ = new gfx::ImageSkia(gfx::ImageSkiaRep(*bitmap, 1.0f)); |
| 44 gfx::ImageSkiaRep(*bitmap, ui::SCALE_FACTOR_100P)); | |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 46 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
| 48 if (!default_icon_) { | 47 if (!default_icon_) { |
| 49 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 48 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 50 default_icon_ = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); | 49 default_icon_ = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); |
| 51 } | 50 } |
| 52 #elif defined(OS_MACOSX) | 51 #elif defined(OS_MACOSX) |
| 53 if (!default_icon_) { | 52 if (!default_icon_) { |
| 54 // IDR_PRODUCT_LOGO_16 doesn't quite look like chrome/mac's icns icon. Load | 53 // IDR_PRODUCT_LOGO_16 doesn't quite look like chrome/mac's icns icon. Load |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 153 } |
| 155 | 154 |
| 156 void BrowserProcessResourceProvider::StartUpdating() { | 155 void BrowserProcessResourceProvider::StartUpdating() { |
| 157 task_manager_->AddResource(&resource_); | 156 task_manager_->AddResource(&resource_); |
| 158 } | 157 } |
| 159 | 158 |
| 160 void BrowserProcessResourceProvider::StopUpdating() { | 159 void BrowserProcessResourceProvider::StopUpdating() { |
| 161 } | 160 } |
| 162 | 161 |
| 163 } // namespace task_manager | 162 } // namespace task_manager |
| OLD | NEW |