OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/status_icons/status_icon.h" | 5 #include "chrome/browser/status_icons/status_icon.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "build/build_config.h" | 9 #include "build/build_config.h" |
8 #include "chrome/browser/status_icons/status_icon_observer.h" | 10 #include "chrome/browser/status_icons/status_icon_observer.h" |
9 | 11 |
10 StatusIcon::StatusIcon() { | 12 StatusIcon::StatusIcon() { |
11 } | 13 } |
12 | 14 |
13 StatusIcon::~StatusIcon() { | 15 StatusIcon::~StatusIcon() { |
14 } | 16 } |
15 | 17 |
16 void StatusIcon::AddObserver(StatusIconObserver* observer) { | 18 void StatusIcon::AddObserver(StatusIconObserver* observer) { |
(...skipping 16 matching lines...) Expand all Loading... |
33 void StatusIcon::DispatchBalloonClickEvent() { | 35 void StatusIcon::DispatchBalloonClickEvent() { |
34 FOR_EACH_OBSERVER(StatusIconObserver, observers_, OnBalloonClicked()); | 36 FOR_EACH_OBSERVER(StatusIconObserver, observers_, OnBalloonClicked()); |
35 } | 37 } |
36 #endif | 38 #endif |
37 | 39 |
38 void StatusIcon::ForceVisible() {} | 40 void StatusIcon::ForceVisible() {} |
39 | 41 |
40 void StatusIcon::SetContextMenu(scoped_ptr<StatusIconMenuModel> menu) { | 42 void StatusIcon::SetContextMenu(scoped_ptr<StatusIconMenuModel> menu) { |
41 // The UI may been showing a menu for the current model, don't destroy it | 43 // The UI may been showing a menu for the current model, don't destroy it |
42 // until we've notified the UI of the change. | 44 // until we've notified the UI of the change. |
43 scoped_ptr<StatusIconMenuModel> old_menu = context_menu_contents_.Pass(); | 45 scoped_ptr<StatusIconMenuModel> old_menu = std::move(context_menu_contents_); |
44 context_menu_contents_ = menu.Pass(); | 46 context_menu_contents_ = std::move(menu); |
45 UpdatePlatformContextMenu(context_menu_contents_.get()); | 47 UpdatePlatformContextMenu(context_menu_contents_.get()); |
46 } | 48 } |
OLD | NEW |