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/status_icons/status_icon_menu_model.h" | 5 #include "chrome/browser/status_icons/status_icon_menu_model.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "ui/base/accelerators/accelerator.h" | 9 #include "ui/base/accelerators/accelerator.h" |
10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 //////////////////////////////////////////////////////////////////////////////// | 158 //////////////////////////////////////////////////////////////////////////////// |
159 // StatusIconMenuModel, protected: | 159 // StatusIconMenuModel, protected: |
160 | 160 |
161 void StatusIconMenuModel::MenuItemsChanged() { | 161 void StatusIconMenuModel::MenuItemsChanged() { |
162 NotifyMenuStateChanged(); | 162 NotifyMenuStateChanged(); |
163 } | 163 } |
164 | 164 |
165 void StatusIconMenuModel::NotifyMenuStateChanged() { | 165 void StatusIconMenuModel::NotifyMenuStateChanged() { |
166 FOR_EACH_OBSERVER(Observer, observer_list_, OnMenuStateChanged()); | 166 for (Observer& observer : observer_list_) |
| 167 observer.OnMenuStateChanged(); |
167 } | 168 } |
168 | 169 |
169 //////////////////////////////////////////////////////////////////////////////// | 170 //////////////////////////////////////////////////////////////////////////////// |
170 // StatusIconMenuModel, private: | 171 // StatusIconMenuModel, private: |
171 | 172 |
172 void StatusIconMenuModel::CommandIdHighlighted(int command_id) { | 173 void StatusIconMenuModel::CommandIdHighlighted(int command_id) { |
173 if (delegate_) | 174 if (delegate_) |
174 delegate_->CommandIdHighlighted(command_id); | 175 delegate_->CommandIdHighlighted(command_id); |
175 } | 176 } |
176 | 177 |
177 void StatusIconMenuModel::ExecuteCommand(int command_id, int event_flags) { | 178 void StatusIconMenuModel::ExecuteCommand(int command_id, int event_flags) { |
178 if (delegate_) | 179 if (delegate_) |
179 delegate_->ExecuteCommand(command_id, event_flags); | 180 delegate_->ExecuteCommand(command_id, event_flags); |
180 } | 181 } |
OLD | NEW |