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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« 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