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

Side by Side Diff: chrome/browser/ui/views/frame/system_menu_model_builder.cc

Issue 1336823003: Move chrome::HostDesktopType to ui::HostDesktopType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@base_session_service_delegate_impl
Patch Set: Fix build on Mac and CrOS Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/system_menu_model_builder.h" 5 #include "chrome/browser/ui/views/frame/system_menu_model_builder.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 SystemMenuModelBuilder::~SystemMenuModelBuilder() { 54 SystemMenuModelBuilder::~SystemMenuModelBuilder() {
55 } 55 }
56 56
57 void SystemMenuModelBuilder::Init() { 57 void SystemMenuModelBuilder::Init() {
58 ui::SimpleMenuModel* model = new ui::SimpleMenuModel(&menu_delegate_); 58 ui::SimpleMenuModel* model = new ui::SimpleMenuModel(&menu_delegate_);
59 menu_model_.reset(model); 59 menu_model_.reset(model);
60 BuildMenu(model); 60 BuildMenu(model);
61 #if defined(OS_WIN) 61 #if defined(OS_WIN)
62 // On Windows with HOST_DESKTOP_TYPE_NATIVE we put the menu items in the 62 // On Windows with ui::HOST_DESKTOP_TYPE_NATIVE we put the menu items in the
63 // system menu (not at the end). Doing this necessitates adding a trailing 63 // system menu (not at the end). Doing this necessitates adding a trailing
64 // separator. 64 // separator.
65 if (browser()->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) 65 if (browser()->host_desktop_type() == ui::HOST_DESKTOP_TYPE_NATIVE)
66 model->AddSeparator(ui::NORMAL_SEPARATOR); 66 model->AddSeparator(ui::NORMAL_SEPARATOR);
67 #endif 67 #endif
68 } 68 }
69 69
70 void SystemMenuModelBuilder::BuildMenu(ui::SimpleMenuModel* model) { 70 void SystemMenuModelBuilder::BuildMenu(ui::SimpleMenuModel* model) {
71 // We add the menu items in reverse order so that insertion_index never needs 71 // We add the menu items in reverse order so that insertion_index never needs
72 // to change. 72 // to change.
73 if (browser()->is_type_tabbed()) 73 if (browser()->is_type_tabbed())
74 BuildSystemMenuForBrowserWindow(model); 74 BuildSystemMenuForBrowserWindow(model);
75 else 75 else
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const user_manager::UserInfo* user_info = delegate->GetUserInfo(user_index); 181 const user_manager::UserInfo* user_info = delegate->GetUserInfo(user_index);
182 model->AddItem( 182 model->AddItem(
183 user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 183 user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2
184 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, 184 : IDC_VISIT_DESKTOP_OF_LRU_USER_3,
185 l10n_util::GetStringFUTF16(IDS_VISIT_DESKTOP_OF_LRU_USER, 185 l10n_util::GetStringFUTF16(IDS_VISIT_DESKTOP_OF_LRU_USER,
186 user_info->GetDisplayName(), 186 user_info->GetDisplayName(),
187 base::ASCIIToUTF16(user_info->GetEmail()))); 187 base::ASCIIToUTF16(user_info->GetEmail())));
188 } 188 }
189 #endif 189 #endif
190 } 190 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698