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

Unified Diff: chrome/browser/ui/libgtk2ui/app_indicator_icon.h

Issue 716253002: Make system tray icons not show up as blurry on KDE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@system_tray_proper
Patch Set: Created 6 years, 1 month 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 | « no previous file | chrome/browser/ui/libgtk2ui/app_indicator_icon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/app_indicator_icon.h
diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h b/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
index 0ceaab7bc552443eb6e23519a4d4dd210b36040b..81f51650a230ad6d43311620588780c009758ff5 100644
--- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
+++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
@@ -14,6 +14,8 @@
typedef struct _AppIndicator AppIndicator;
typedef struct _GtkWidget GtkWidget;
+class SkBitmap;
+
namespace gfx {
class ImageSkia;
}
@@ -45,7 +47,31 @@ class AppIndicatorIcon : public views::StatusIconLinux {
void RefreshPlatformContextMenu() override;
private:
- void SetImageFromFile(const base::FilePath& icon_file_path);
+ struct SetImageFromFileParams {
+ // The temporary directory in which the icon(s) were written.
+ base::FilePath parent_temp_dir;
+
+ // The icon theme path to pass to libappindicator.
+ std::string icon_theme_path;
+
+ // The icon name to pass to libappindicator.
+ std::string icon_name;
+ };
+
+ // Writes |bitmap| to a temporary directory on a worker thread. The temporary
+ // directory is selected based on KDE's quirks.
+ static SetImageFromFileParams WriteKDE4TempImageOnWorkerThread(
+ const SkBitmap& bitmap,
+ const base::FilePath& existing_temp_dir);
+
+ // Writes |bitmap| to a temporary directory on a worker thread. The temporary
+ // directory is selected based on Unity's quirks.
+ static SetImageFromFileParams WriteUnityTempImageOnWorkerThread(
+ const SkBitmap& bitmap,
+ int icon_change_count,
+ const std::string& id);
+
+ void SetImageFromFile(const SetImageFromFileParams& params);
void SetMenu();
// Sets a menu item at the top of the menu as a replacement for the status
@@ -68,7 +94,7 @@ class AppIndicatorIcon : public views::StatusIconLinux {
scoped_ptr<AppIndicatorIconMenu> menu_;
ui::MenuModel* menu_model_;
- base::FilePath icon_file_path_;
+ base::FilePath temp_dir_;
int icon_change_count_;
base::WeakPtrFactory<AppIndicatorIcon> weak_factory_;
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/app_indicator_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698