linux: Remove all the X and GTK+ related implementations.
Now we only uses GTK+ for app indicator and status icon, also notice the in Chrome35 the Gtk2StatusIcon class doesn't exist yet so we shipp related files under chromium_src, remember to delete them after upgraded to Chrome36.
This commit is contained in:
parent
49160819d2
commit
3349b8e6c7
39 changed files with 426 additions and 3900 deletions
|
@ -2,17 +2,58 @@
|
|||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/ui/gtk/status_icon.h"
|
||||
#include "atom/browser/ui/gtk/app_indicator_icon.h"
|
||||
#include "atom/browser/ui/tray_icon_gtk.h"
|
||||
|
||||
#include "base/guid.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h"
|
||||
#include "chrome/browser/ui/libgtk2ui/gtk2_status_icon.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
TrayIconGtk::TrayIconGtk() {
|
||||
}
|
||||
|
||||
TrayIconGtk::~TrayIconGtk() {
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetImage(const gfx::ImageSkia& image) {
|
||||
if (icon_) {
|
||||
icon_->SetImage(image);
|
||||
return;
|
||||
}
|
||||
|
||||
base::string16 empty;
|
||||
if (libgtk2ui::AppIndicatorIcon::CouldOpen())
|
||||
icon_.reset(
|
||||
new libgtk2ui::AppIndicatorIcon(base::GenerateGUID(), image, empty));
|
||||
else
|
||||
icon_.reset(new libgtk2ui::Gtk2StatusIcon(image, empty));
|
||||
icon_->set_delegate(this);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetPressedImage(const gfx::ImageSkia& image) {
|
||||
icon_->SetPressedImage(image);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetToolTip(const std::string& tool_tip) {
|
||||
icon_->SetToolTip(base::UTF8ToUTF16(tool_tip));
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetContextMenu(ui::SimpleMenuModel* menu_model) {
|
||||
icon_->UpdatePlatformContextMenu(menu_model);
|
||||
}
|
||||
|
||||
void TrayIconGtk::OnClick() {
|
||||
}
|
||||
|
||||
bool TrayIconGtk::HasClickAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
TrayIcon* TrayIcon::Create() {
|
||||
if (AppIndicatorIcon::CouldOpen())
|
||||
return new AppIndicatorIcon;
|
||||
else
|
||||
return new StatusIcon;
|
||||
return new TrayIconGtk;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue