| Index: chrome/browser/ui/views/frame/system_menu_model.cc
|
| diff --git a/chrome/browser/ui/views/frame/system_menu_model.cc b/chrome/browser/ui/views/frame/system_menu_model.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1affc2aa9e52590e3e218cf440a19fb686581367
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/frame/system_menu_model.cc
|
| @@ -0,0 +1,25 @@
|
| +// 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;
|
| +}
|
|
|