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

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

Issue 2449243002: Gtk3 ui: Add libgtk3ui as a separate build component (Closed)
Patch Set: Add theme_properties dep to //chrome/browser/ui Created 4 years, 2 months 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 | « chrome/browser/ui/libgtk2ui/OWNERS ('k') | 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
deleted file mode 100644
index 2bd2f1eb0b1666c6683f453e4a46017f46403a2a..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_
-#define CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_
-
-#include <memory>
-
-#include "base/files/file_path.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "base/nix/xdg_util.h"
-#include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
-#include "ui/views/linux_ui/status_icon_linux.h"
-
-typedef struct _AppIndicator AppIndicator;
-typedef struct _GtkWidget GtkWidget;
-
-class SkBitmap;
-
-namespace gfx {
-class ImageSkia;
-}
-
-namespace ui {
-class MenuModel;
-}
-
-namespace libgtk2ui {
-class AppIndicatorIconMenu;
-
-// Status icon implementation which uses libappindicator.
-class AppIndicatorIcon : public views::StatusIconLinux {
- public:
- // The id uniquely identifies the new status icon from other chrome status
- // icons.
- AppIndicatorIcon(std::string id,
- const gfx::ImageSkia& image,
- const base::string16& tool_tip);
- ~AppIndicatorIcon() override;
-
- // Indicates whether libappindicator so could be opened.
- static bool CouldOpen();
-
- // Overridden from views::StatusIconLinux:
- void SetImage(const gfx::ImageSkia& image) override;
- void SetToolTip(const base::string16& tool_tip) override;
- void UpdatePlatformContextMenu(ui::MenuModel* menu) override;
- void RefreshPlatformContextMenu() override;
-
- private:
- 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
- // icon click action. Clicking on this menu item should simulate a status icon
- // click by despatching a click event.
- void UpdateClickActionReplacementMenuItem();
-
- // Callback for when the status icon click replacement menu item is activated.
- void OnClickActionReplacementMenuItemActivated();
-
- std::string id_;
- std::string tool_tip_;
-
- // Used to select KDE or Unity for image setting.
- base::nix::DesktopEnvironment desktop_env_;
-
- // Gtk status icon wrapper
- AppIndicator* icon_;
-
- std::unique_ptr<AppIndicatorIconMenu> menu_;
- ui::MenuModel* menu_model_;
-
- base::FilePath temp_dir_;
- int icon_change_count_;
-
- base::WeakPtrFactory<AppIndicatorIcon> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon);
-};
-
-} // namespace libgtk2ui
-
-#endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_
« no previous file with comments | « chrome/browser/ui/libgtk2ui/OWNERS ('k') | chrome/browser/ui/libgtk2ui/app_indicator_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698