Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: chrome/browser/ui/views/frame/system_menu_model.cc

Issue 9966007: views: Extract SystemMenuModel from native_menu_win.*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include string16 Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/system_menu_model.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « chrome/browser/ui/views/frame/system_menu_model.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698