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

Side by Side Diff: views/controls/menu/menu_host_win.cc

Issue 3823002: Move windows version-related stuff out of base/win_util and into base/win/win... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/menu/menu_host_win.h" 5 #include "views/controls/menu/menu_host_win.h"
6 6
7 #include "base/win_util.h" 7 #include "base/win/windows_version.h"
8 #include "views/controls/menu/menu_controller.h" 8 #include "views/controls/menu/menu_controller.h"
9 #include "views/controls/menu/menu_host_root_view.h" 9 #include "views/controls/menu/menu_host_root_view.h"
10 #include "views/controls/menu/menu_item_view.h" 10 #include "views/controls/menu/menu_item_view.h"
11 #include "views/controls/menu/submenu_view.h" 11 #include "views/controls/menu/submenu_view.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 // static 15 // static
16 MenuHost* MenuHost::Create(SubmenuView* submenu_view) { 16 MenuHost* MenuHost::Create(SubmenuView* submenu_view) {
17 return new MenuHostWin(submenu_view); 17 return new MenuHostWin(submenu_view);
18 } 18 }
19 19
20 MenuHostWin::MenuHostWin(SubmenuView* submenu) 20 MenuHostWin::MenuHostWin(SubmenuView* submenu)
21 : destroying_(false), 21 : destroying_(false),
22 submenu_(submenu), 22 submenu_(submenu),
23 owns_capture_(false) { 23 owns_capture_(false) {
24 set_window_style(WS_POPUP); 24 set_window_style(WS_POPUP);
25 set_initial_class_style( 25 set_initial_class_style(
26 (win_util::GetWinVersion() < win_util::WINVERSION_XP) ? 26 (base::win::GetVersion() < base::win::VERSION_XP) ?
27 0 : CS_DROPSHADOW); 27 0 : CS_DROPSHADOW);
28 is_mouse_down_ = 28 is_mouse_down_ =
29 ((GetKeyState(VK_LBUTTON) & 0x80) || 29 ((GetKeyState(VK_LBUTTON) & 0x80) ||
30 (GetKeyState(VK_RBUTTON) & 0x80) || 30 (GetKeyState(VK_RBUTTON) & 0x80) ||
31 (GetKeyState(VK_MBUTTON) & 0x80) || 31 (GetKeyState(VK_MBUTTON) & 0x80) ||
32 (GetKeyState(VK_XBUTTON1) & 0x80) || 32 (GetKeyState(VK_XBUTTON1) & 0x80) ||
33 (GetKeyState(VK_XBUTTON2) & 0x80)); 33 (GetKeyState(VK_XBUTTON2) & 0x80));
34 // Mouse clicks shouldn't give us focus. 34 // Mouse clicks shouldn't give us focus.
35 set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE); 35 set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE);
36 } 36 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 void MenuHostWin::DoCapture() { 121 void MenuHostWin::DoCapture() {
122 owns_capture_ = true; 122 owns_capture_ = true;
123 SetCapture(); 123 SetCapture();
124 has_capture_ = true; 124 has_capture_ = true;
125 #ifdef DEBUG_MENU 125 #ifdef DEBUG_MENU
126 DLOG(INFO) << "Doing capture"; 126 DLOG(INFO) << "Doing capture";
127 #endif 127 #endif
128 } 128 }
129 129
130 } // namespace views 130 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698