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

Side by Side Diff: ui/base/win/foreground_helper.h

Issue 146833020: Remove some uses of ATL in UI code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 | « ui/aura/root_window_host_win.cc ('k') | ui/base/win/foreground_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef UI_BASE_WIN_FOREGROUND_HELPER_H_ 5 #ifndef UI_BASE_WIN_FOREGROUND_HELPER_H_
6 #define UI_BASE_WIN_FOREGROUND_HELPER_H_ 6 #define UI_BASE_WIN_FOREGROUND_HELPER_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/base/ui_base_export.h" 9 #include "ui/base/ui_base_export.h"
10 #include "ui/gfx/win/window_impl.h" 10 #include "ui/gfx/win/window_impl.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 // Helper class for moving a window to the foreground. 14 // Helper class for moving a window to the foreground.
15 // Windows XP and later will not allow a window which is in the background to 15 // Windows XP and later will not allow a window which is in the background to
16 // move to the foreground, unless requested by the current window in the 16 // move to the foreground, unless requested by the current window in the
17 // foreground. For automated testing, we really want some of our windows 17 // foreground. For automated testing, we really want some of our windows
18 // to be capable of moving to the foreground. 18 // to be capable of moving to the foreground.
19 // 19 //
20 // This is probably leveraging a windows bug. 20 // This is probably leveraging a windows bug.
21 class UI_BASE_EXPORT ForegroundHelper : public gfx::WindowImpl { 21 class UI_BASE_EXPORT ForegroundHelper : public gfx::WindowImpl {
22 public: 22 public:
23 ForegroundHelper() : window_(NULL) { } 23 ForegroundHelper() : window_(NULL) { }
24 24
25 BEGIN_MSG_MAP_EX(ForegroundHelper) 25 CR_BEGIN_MSG_MAP_EX(ForegroundHelper)
26 MESSAGE_HANDLER(WM_HOTKEY, OnHotKey) 26 CR_MSG_WM_HOTKEY(OnHotKey)
27 END_MSG_MAP() 27 CR_END_MSG_MAP()
28 28
29 // Brings a window into the foreground. 29 // Brings a window into the foreground.
30 // Can be called from any window, even if the caller is not the 30 // Can be called from any window, even if the caller is not the
31 // foreground window. 31 // foreground window.
32 static HRESULT SetForeground(HWND window); 32 static HRESULT SetForeground(HWND window);
33 33
34 private: 34 private:
35 HRESULT ForegroundHotKey(HWND window); 35 HRESULT ForegroundHotKey(HWND window);
36 36
37 // Handle the registered Hotkey being pressed. 37 // Handle the registered Hotkey being pressed.
38 LRESULT OnHotKey(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); 38 void OnHotKey(int id, UINT vcode, UINT modifiers);
39 39
40 HWND window_; 40 HWND window_;
41 41
42 DISALLOW_COPY_AND_ASSIGN(ForegroundHelper); 42 DISALLOW_COPY_AND_ASSIGN(ForegroundHelper);
43 }; 43 };
44 44
45 } // namespace ui 45 } // namespace ui
46 46
47 #endif // UI_BASE_WIN_FOREGROUND_HELPER_H_ 47 #endif // UI_BASE_WIN_FOREGROUND_HELPER_H_
OLDNEW
« no previous file with comments | « ui/aura/root_window_host_win.cc ('k') | ui/base/win/foreground_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698