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

Unified Diff: views/window/window_win.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « views/window/window_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/window_win.cc
===================================================================
--- views/window/window_win.cc (revision 85284)
+++ views/window/window_win.cc (working copy)
@@ -233,6 +233,30 @@
////////////////////////////////////////////////////////////////////////////////
// WindowWin, public:
+WindowWin::WindowWin(internal::NativeWindowDelegate* delegate)
+ : WidgetWin(delegate->AsNativeWidgetDelegate()),
+ delegate_(delegate),
+ focus_on_creation_(true),
+ restored_enabled_(false),
+ fullscreen_(false),
+ is_active_(false),
+ lock_updates_(false),
+ saved_window_style_(0),
+ ignore_window_pos_changes_(false),
+ ignore_pos_changes_factory_(this),
+ force_hidden_count_(0),
+ is_right_mouse_pressed_on_caption_(false),
+ last_monitor_(NULL),
+ is_in_size_move_(false) {
+ is_window_ = true;
+ // Initialize these values to 0 so that subclasses can override the default
+ // behavior before calling Init.
+ set_window_style(0);
+ set_window_ex_style(0);
+}
+
+
+
WindowWin::~WindowWin() {
}
@@ -283,28 +307,6 @@
///////////////////////////////////////////////////////////////////////////////
// WindowWin, protected:
-WindowWin::WindowWin()
- : ALLOW_THIS_IN_INITIALIZER_LIST(delegate_(this)),
- focus_on_creation_(true),
- restored_enabled_(false),
- fullscreen_(false),
- is_active_(false),
- lock_updates_(false),
- saved_window_style_(0),
- ignore_window_pos_changes_(false),
- ignore_pos_changes_factory_(this),
- force_hidden_count_(0),
- is_right_mouse_pressed_on_caption_(false),
- last_monitor_(NULL),
- is_in_size_move_(false) {
- SetNativeWindow(this);
- is_window_ = true;
- // Initialize these values to 0 so that subclasses can override the default
- // behavior before calling Init.
- set_window_style(0);
- set_window_ex_style(0);
-}
-
gfx::Insets WindowWin::GetClientAreaInsets() const {
// Returning an empty Insets object causes the default handling in
// WidgetWin::OnNCCalcSize() to be invoked.
@@ -371,7 +373,7 @@
}
void WindowWin::OnClose() {
- GetWindow()->CloseWindow();
+ GetWindow()->Close();
}
void WindowWin::OnCommand(UINT notification_code, int command_id, HWND window) {
@@ -412,7 +414,7 @@
WidgetWin::OnExitSizeMove();
delegate_->OnNativeWindowEndUserBoundsChange();
- if (!GetThemeProvider()->ShouldUseNativeFrame()) {
+ if (!ShouldUseNativeFrame()) {
// Sending SWP_FRAMECHANGED forces a non-client repaint, which fixes the
// glitch in rendering the bottom pixel of the window caused by us
// offsetting the client rect there (See comment in GetClientAreaInsets()).
@@ -773,7 +775,8 @@
!!(GetKeyState(VK_SHIFT) & 0x8000),
!!(GetKeyState(VK_CONTROL) & 0x8000),
false);
- GetFocusManager()->ProcessAccelerator(accelerator);
+ AsNativeWidget()->GetWidget()->GetFocusManager()->
+ ProcessAccelerator(accelerator);
return;
}
@@ -892,6 +895,14 @@
////////////////////////////////////////////////////////////////////////////////
// WindowWin, NativeWindow implementation:
+Window* WindowWin::GetWindow() {
+ return delegate_->AsWindow();
+}
+
+const Window* WindowWin::GetWindow() const {
+ return delegate_->AsWindow();
+}
+
NativeWidget* WindowWin::AsNativeWidget() {
return this;
}
@@ -1163,10 +1174,6 @@
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
-bool WindowWin::IsAppWindow() const {
- return false;
-}
-
void WindowWin::SetUseDragFrame(bool use_drag_frame) {
if (use_drag_frame) {
// Make the frame slightly transparent during the drag operation.
@@ -1187,8 +1194,8 @@
NonClientFrameView* WindowWin::CreateFrameViewForWindow() {
if (ShouldUseNativeFrame())
- return new NativeFrameView(this);
- return new CustomFrameView(this);
+ return new NativeFrameView(GetWindow());
+ return new CustomFrameView(GetWindow());
}
void WindowWin::UpdateFrameAfterFrameChange() {
@@ -1201,10 +1208,7 @@
}
bool WindowWin::ShouldUseNativeFrame() const {
- ui::ThemeProvider* tp = GetThemeProvider();
- if (!tp)
- return WidgetWin::IsAeroGlassEnabled();
- return tp->ShouldUseNativeFrame();
+ return WidgetWin::IsAeroGlassEnabled();
}
void WindowWin::FrameTypeChanged() {
@@ -1344,26 +1348,13 @@
SendMessage(GetNativeView(), WM_SYSCOMMAND, command, 0);
}
-namespace {
-BOOL CALLBACK WindowCallbackProc(HWND hwnd, LPARAM lParam) {
- NativeWidget* native_widget =
- NativeWidget::GetNativeWidgetForNativeView(hwnd);
- if (native_widget)
- Window::CloseSecondaryWidget(native_widget->GetWidget());
- return TRUE;
-}
-} // namespace
-
-void Window::CloseAllSecondaryWindows() {
- EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0);
-}
-
////////////////////////////////////////////////////////////////////////////////
// NativeWindow, public:
// static
-Window* NativeWindow::CreateNativeWindow() {
- return new WindowWin;
+NativeWindow* NativeWindow::CreateNativeWindow(
+ internal::NativeWindowDelegate* delegate) {
+ return new WindowWin(delegate);
}
} // namespace views
« no previous file with comments | « views/window/window_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698