| Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| index c249cc6bda3a007b37b747a71e2fc76ef1bba82e..d2774bfc5cbe56f90425d2c58d58e5da03491c7e 100644
|
| --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| @@ -12,7 +12,9 @@
|
| #include "base/logging.h"
|
| #include "base/nix/mime_util_xdg.h"
|
| #include "base/stl_util.h"
|
| +#include "base/strings/stringprintf.h"
|
| #include "chrome/browser/themes/theme_properties.h"
|
| +#include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h"
|
| #include "chrome/browser/ui/libgtk2ui/chrome_gtk_frame.h"
|
| #include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
|
| #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h"
|
| @@ -49,6 +51,12 @@
|
|
|
| namespace {
|
|
|
| +// Prefix for app indicator ids
|
| +const char kAppIndicatorIdPrefix[] = "chrome_app_indicator_";
|
| +
|
| +// Number of app indicators used (used as part of app-indicator id).
|
| +int indicators_count;
|
| +
|
| // The size of the rendered toolbar image.
|
| const int kToolbarImageWidth = 64;
|
| const int kToolbarImageHeight = 128;
|
| @@ -303,6 +311,8 @@ Gtk2UI::Gtk2UI() {
|
| // style-set signal handler.
|
| LoadGtkValues();
|
| SetXDGIconTheme();
|
| +
|
| + indicators_count = 0;
|
| }
|
|
|
| Gtk2UI::~Gtk2UI() {
|
| @@ -380,6 +390,16 @@ void Gtk2UI::SetProgressFraction(float percentage) const {
|
| unity::SetProgressFraction(percentage);
|
| }
|
|
|
| +StatusIconLinux* Gtk2UI::CreateLinuxStatusIcon() const {
|
| + if (AppIndicatorIcon::CouldOpen()) {
|
| + ++indicators_count;
|
| + return new AppIndicatorIcon(
|
| + base::StringPrintf("%s%d", kAppIndicatorIdPrefix, indicators_count));
|
| + } else {
|
| + return NULL;
|
| + }
|
| +}
|
| +
|
| ui::SelectFileDialog* Gtk2UI::CreateSelectFileDialog(
|
| ui::SelectFileDialog::Listener* listener,
|
| ui::SelectFilePolicy* policy) const {
|
|
|