| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/frame/system_menu_model.h" |
| 6 |
| 7 #include <windows.h> |
| 8 |
| 9 #include <algorithm> |
| 10 |
| 11 SystemMenuModel::SystemMenuModel(ui::SimpleMenuModel::Delegate* delegate) |
| 12 : ui::SimpleMenuModel(delegate) { |
| 13 } |
| 14 |
| 15 SystemMenuModel::~SystemMenuModel() { |
| 16 } |
| 17 |
| 18 int SystemMenuModel::GetFirstItemIndex(gfx::NativeMenu native_menu) const { |
| 19 // We allow insertions before last item (Close). |
| 20 return std::max(0, GetMenuItemCount(native_menu) - 1); |
| 21 } |
| 22 |
| 23 int SystemMenuModel::FlipIndex(int index) const { |
| 24 return GetItemCount() - index - 1; |
| 25 } |
| OLD | NEW |