Add icon manager to browser process

This commit is contained in:
Yury Solovyov 2016-10-30 17:10:09 +03:00 committed by Kevin Sawicki
parent 602aba8723
commit 1b3cd87fc9
3 changed files with 12 additions and 1 deletions

View file

@ -42,7 +42,7 @@ class FileIconFetcher {
gfx::Image* icon);
// Tracks tasks requesting file icons.
base::CancelableTaskTracker cancelable_task_tracker_;
static base::CancelableTaskTracker cancelable_task_tracker_;
};
#endif // ATOM_COMMON_API_FILEICON_FETCHER_H_

View file

@ -5,6 +5,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/icon_manager.h"
#include "ui/base/l10n/l10n_util.h"
BrowserProcess* g_browser_process = NULL;
@ -12,6 +13,8 @@ BrowserProcess* g_browser_process = NULL;
BrowserProcess::BrowserProcess()
: print_job_manager_(new printing::PrintJobManager) {
g_browser_process = this;
icon_manager_.reset(new IconManager);
}
BrowserProcess::~BrowserProcess() {
@ -25,3 +28,7 @@ std::string BrowserProcess::GetApplicationLocale() {
printing::PrintJobManager* BrowserProcess::print_job_manager() {
return print_job_manager_.get();
}
IconManager* BrowserProcess::icon_manager() {
return icon_manager_.get();
}

View file

@ -19,6 +19,8 @@ namespace printing {
class PrintJobManager;
}
class IconManager;
// NOT THREAD SAFE, call only from the main thread.
// These functions shouldn't return NULL unless otherwise noted.
class BrowserProcess {
@ -29,9 +31,11 @@ class BrowserProcess {
std::string GetApplicationLocale();
printing::PrintJobManager* print_job_manager();
IconManager* icon_manager();
private:
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
std::unique_ptr<IconManager> icon_manager_;
DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
};