blob: 1affc2aa9e52590e3e218cf440a19fb686581367 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/frame/system_menu_model.h"
#include <windows.h>
#include <algorithm>
SystemMenuModel::SystemMenuModel(ui::SimpleMenuModel::Delegate* delegate)
: ui::SimpleMenuModel(delegate) {
}
SystemMenuModel::~SystemMenuModel() {
}
int SystemMenuModel::GetFirstItemIndex(gfx::NativeMenu native_menu) const {
// We allow insertions before last item (Close).
return std::max(0, GetMenuItemCount(native_menu) - 1);
}
int SystemMenuModel::FlipIndex(int index) const {
return GetItemCount() - index - 1;
}