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

Unified Diff: chrome/views/widget/widget_win.cc

Issue 99133: Removes an unused boolean passed to MoveToFront. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/views/widget/widget_win.h ('k') | chrome/views/window/non_client_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/widget/widget_win.cc
===================================================================
--- chrome/views/widget/widget_win.cc (revision 14739)
+++ chrome/views/widget/widget_win.cc (working copy)
@@ -18,6 +18,7 @@
#include "chrome/views/widget/aero_tooltip_manager.h"
#include "chrome/views/widget/hwnd_notification_source.h"
#include "chrome/views/widget/root_view.h"
+#include "chrome/views/window/window_win.h"
namespace views {
@@ -145,6 +146,7 @@
can_update_layered_window_(true),
last_mouse_event_was_move_(false),
is_mouse_down_(false),
+ is_window_(false),
class_style_(CS_DBLCLKS),
hwnd_(NULL) {
}
@@ -252,20 +254,6 @@
crect.Width(), crect.Height());
}
-void WidgetWin::MoveToFront(bool should_activate) {
- int flags = SWP_NOMOVE | SWP_NOSIZE;
- if (!should_activate) {
- flags |= SWP_NOACTIVATE;
- }
-
- // Keep the window topmost if it was already topmost.
- WINDOWINFO wi;
- wi.cbSize = sizeof WINDOWINFO;
- GetWindowInfo(GetNativeView(), &wi);
- SetWindowPos((wi.dwExStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST,
- 0, 0, 0, 0, flags);
-}
-
gfx::NativeView WidgetWin::GetNativeView() const {
return hwnd_;
}
@@ -319,7 +307,14 @@
return tooltip_manager_.get();
}
+Window* WidgetWin::GetWindow() {
+ return GetWindowImpl(hwnd_);
+}
+const Window* WidgetWin::GetWindow() const {
+ return GetWindowImpl(hwnd_);
+}
+
void WidgetWin::SetLayeredAlpha(BYTE layered_alpha) {
layered_alpha_ = layered_alpha;
@@ -850,6 +845,21 @@
///////////////////////////////////////////////////////////////////////////////
// WidgetWin, private:
+// static
+Window* WidgetWin::GetWindowImpl(HWND hwnd) {
+ // NOTE: we can't use GetAncestor here as constrained windows are a Window,
+ // but not a top level window.
+ HWND parent = hwnd;
+ while (parent) {
+ WidgetWin* widget =
+ reinterpret_cast<WidgetWin*>(win_util::GetWindowUserData(parent));
+ if (widget && widget->is_window_)
+ return static_cast<WindowWin*>(widget);
+ parent = ::GetParent(parent);
+ }
+ return NULL;
+}
+
void WidgetWin::SizeContents(const CRect& window_rect) {
contents_.reset(new ChromeCanvas(window_rect.Width(),
window_rect.Height(),
« no previous file with comments | « chrome/views/widget/widget_win.h ('k') | chrome/views/window/non_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698