OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.h" |
| 6 |
| 7 StatusIconLinuxWrapper::StatusIconLinuxWrapper(StatusIconLinux* status_icon) { |
| 8 status_icon_.reset(status_icon); |
| 9 status_icon_->set_delegate(this); |
| 10 } |
| 11 |
| 12 void StatusIconLinuxWrapper::SetImage(const gfx::ImageSkia& image) { |
| 13 status_icon_->SetImage(image); |
| 14 } |
| 15 |
| 16 void StatusIconLinuxWrapper::SetPressedImage(const gfx::ImageSkia& image) { |
| 17 status_icon_->SetPressedImage(image); |
| 18 } |
| 19 |
| 20 void StatusIconLinuxWrapper::SetToolTip(const string16& tool_tip) { |
| 21 status_icon_->SetToolTip(tool_tip); |
| 22 } |
| 23 |
| 24 void StatusIconLinuxWrapper::SetClickActionLabel(const string16& label) { |
| 25 status_icon_->SetClickActionLabel(label); |
| 26 } |
| 27 |
| 28 void StatusIconLinuxWrapper::DisplayBalloon(const gfx::ImageSkia& icon, |
| 29 const string16& title, |
| 30 const string16& contents) { |
| 31 notification_.DisplayBalloon(icon, title, contents); |
| 32 } |
| 33 |
| 34 void StatusIconLinuxWrapper::OnClick() { |
| 35 DispatchClickEvent(); |
| 36 } |
| 37 |
| 38 StatusIconLinuxWrapper* StatusIconLinuxWrapper::CreateWrappedStatusIcon() { |
| 39 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance(); |
| 40 if (linux_ui) { |
| 41 scoped_ptr<StatusIconLinux> status_icon = linux_ui->CreateLinuxStatusIcon(); |
| 42 if (status_icon.get()) |
| 43 return new StatusIconLinuxWrapper(status_icon.release()); |
| 44 } |
| 45 return NULL; |
| 46 } |
| 47 |
| 48 void StatusIconLinuxWrapper::UpdatePlatformContextMenu(ui::MenuModel* model) { |
| 49 status_icon_->UpdatePlatformContextMenu(model); |
| 50 } |
OLD | NEW |