#include "ui/views/widget/widget_hwnd_utils.h"
#include "ui/views/win/fullscreen_handler.h"
#include "ui/views/win/hwnd_message_handler.h"
-#include "ui/views/window/native_frame_view.h"
#include "ui/wm/core/compound_event_filter.h"
#include "ui/wm/core/input_method_event_filter.h"
#include "ui/wm/core/window_animations.h"
}
bool DesktopWindowTreeHostWin::ShouldUseNativeFrame() const {
- return ui::win::IsAeroGlassEnabled();
+ return IsTranslucentWindowOpacitySupported();
}
bool DesktopWindowTreeHostWin::ShouldWindowContentsBeTransparent() const {
SetWindowTransparency();
}
-NonClientFrameView* DesktopWindowTreeHostWin::CreateNonClientFrameView() {
- return GetWidget()->ShouldUseNativeFrame() ?
- new NativeFrameView(GetWidget()) : NULL;
-}
-
void DesktopWindowTreeHostWin::SetFullscreen(bool fullscreen) {
message_handler_->fullscreen_handler()->SetFullscreen(fullscreen);
// TODO(sky): workaround for ScopedFullscreenVisibility showing window
message_handler_->FlashFrame(flash_frame);
}
-void DesktopWindowTreeHostWin::OnRootViewLayout() const {
+void DesktopWindowTreeHostWin::OnRootViewLayout() {
}
void DesktopWindowTreeHostWin::OnNativeWidgetFocus() {
return pending_close_;
}
+bool DesktopWindowTreeHostWin::IsTranslucentWindowOpacitySupported() const {
+ return ui::win::IsAeroGlassEnabled();
+}
+
////////////////////////////////////////////////////////////////////////////////
// DesktopWindowTreeHostWin, WindowTreeHost implementation:
window_enlargement_ =
gfx::Vector2d(new_expanded.width() - expanded.width(),
new_expanded.height() - expanded.height());
- message_handler_->SetBounds(new_expanded);
-
- // The client area size may have changed even though the window bounds have
- // not, if the window bounds were expanded to 64 pixels both times.
- if (old_hwnd_size == new_expanded.size() && old_content_size != bounds.size())
- HandleClientSizeChanged(new_expanded.size());
+ message_handler_->SetBounds(new_expanded, old_content_size != bounds.size());
}
gfx::Point DesktopWindowTreeHostWin::GetLocationOnNativeScreen() const {
const base::NativeEvent& native_event) {
}
-void DesktopWindowTreeHostWin::OnDeviceScaleFactorChanged(
- float device_scale_factor) {
-}
-
void DesktopWindowTreeHostWin::SetCursorNative(gfx::NativeCursor cursor) {
ui::CursorLoaderWin cursor_loader;
cursor_loader.SetPlatformCursor(&cursor);
}
int DesktopWindowTreeHostWin::GetInitialShowState() const {
- return SW_SHOWNORMAL;
+ return CanActivate() ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE;
}
bool DesktopWindowTreeHostWin::WillProcessWorkAreaChange() const {
}
void DesktopWindowTreeHostWin::PaintLayeredWindow(gfx::Canvas* canvas) {
- GetWidget()->GetRootView()->Paint(canvas);
+ GetWidget()->GetRootView()->Paint(canvas, views::CullSet());
}
gfx::NativeViewAccessible DesktopWindowTreeHostWin::GetNativeViewAccessible() {
void DesktopWindowTreeHostWin::HandleCaptureLost() {
OnHostLostWindowCapture();
- native_widget_delegate_->OnMouseCaptureLost();
}
void DesktopWindowTreeHostWin::HandleClose() {
}
void DesktopWindowTreeHostWin::HandlePaint(gfx::Canvas* canvas) {
- compositor()->ScheduleRedrawRect(gfx::Rect());
+ // It appears possible to get WM_PAINT after WM_DESTROY.
+ if (compositor())
+ compositor()->ScheduleRedrawRect(gfx::Rect());
}
bool DesktopWindowTreeHostWin::HandleTooltipNotify(int w_param,
return tooltip_ && tooltip_->HandleNotify(w_param, l_param, l_result);
}
-void DesktopWindowTreeHostWin::HandleTooltipMouseMove(UINT message,
- WPARAM w_param,
- LPARAM l_param) {
- // TooltipWin implementation doesn't need this.
- // TODO(sky): remove from HWNDMessageHandler once non-aura path nuked.
-}
-
void DesktopWindowTreeHostWin::HandleMenuLoop(bool in_menu_loop) {
if (in_menu_loop) {
tooltip_disabler_.reset(