| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.h" | 5 #include "chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.h" |
| 6 | 6 |
| 7 #include "ui/views/linux_ui/linux_ui.h" | 7 #include "ui/views/linux_ui/linux_ui.h" |
| 8 | 8 |
| 9 StatusIconLinuxWrapper::StatusIconLinuxWrapper( | 9 StatusIconLinuxWrapper::StatusIconLinuxWrapper( |
| 10 views::StatusIconLinux* status_icon) | 10 views::StatusIconLinux* status_icon) |
| 11 : menu_model_(NULL) { | 11 : menu_model_(NULL) { |
| 12 status_icon_.reset(status_icon); | 12 status_icon_.reset(status_icon); |
| 13 status_icon_->set_delegate(this); | 13 status_icon_->set_delegate(this); |
| 14 } | 14 } |
| 15 | 15 |
| 16 StatusIconLinuxWrapper::~StatusIconLinuxWrapper() { | 16 StatusIconLinuxWrapper::~StatusIconLinuxWrapper() { |
| 17 if (menu_model_) | 17 if (menu_model_) |
| 18 menu_model_->RemoveObserver(this); | 18 menu_model_->RemoveObserver(this); |
| 19 } | 19 } |
| 20 | 20 |
| 21 void StatusIconLinuxWrapper::SetImage(const gfx::ImageSkia& image) { | 21 void StatusIconLinuxWrapper::SetImage(const gfx::ImageSkia& image) { |
| 22 status_icon_->SetImage(image); | 22 status_icon_->SetImage(image); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void StatusIconLinuxWrapper::SetPressedImage(const gfx::ImageSkia& image) { | |
| 26 status_icon_->SetPressedImage(image); | |
| 27 } | |
| 28 | |
| 29 void StatusIconLinuxWrapper::SetToolTip(const base::string16& tool_tip) { | 25 void StatusIconLinuxWrapper::SetToolTip(const base::string16& tool_tip) { |
| 30 status_icon_->SetToolTip(tool_tip); | 26 status_icon_->SetToolTip(tool_tip); |
| 31 } | 27 } |
| 32 | 28 |
| 33 void StatusIconLinuxWrapper::DisplayBalloon(const gfx::ImageSkia& icon, | 29 void StatusIconLinuxWrapper::DisplayBalloon(const gfx::ImageSkia& icon, |
| 34 const base::string16& title, | 30 const base::string16& title, |
| 35 const base::string16& contents) { | 31 const base::string16& contents) { |
| 36 notification_.DisplayBalloon(icon, title, contents); | 32 notification_.DisplayBalloon(icon, title, contents); |
| 37 } | 33 } |
| 38 | 34 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 66 // If a menu already exists, remove ourself from its oberver list. | 62 // If a menu already exists, remove ourself from its oberver list. |
| 67 if (menu_model_) | 63 if (menu_model_) |
| 68 menu_model_->RemoveObserver(this); | 64 menu_model_->RemoveObserver(this); |
| 69 | 65 |
| 70 status_icon_->UpdatePlatformContextMenu(model); | 66 status_icon_->UpdatePlatformContextMenu(model); |
| 71 menu_model_ = model; | 67 menu_model_ = model; |
| 72 | 68 |
| 73 if (model) | 69 if (model) |
| 74 model->AddObserver(this); | 70 model->AddObserver(this); |
| 75 } | 71 } |
| OLD | NEW |