| Index: chrome/browser/ui/views/frame/browser_frame_win.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/frame/browser_frame_win.cc (revision 153552)
|
| +++ chrome/browser/ui/views/frame/browser_frame_win.cc (working copy)
|
| @@ -195,19 +195,15 @@
|
| NativeWidgetWin::UpdateFrameAfterFrameChange();
|
| }
|
|
|
| -void BrowserFrameWin::OnEndSession(BOOL ending, UINT logoff) {
|
| +void BrowserFrameWin::HandleEndSession() {
|
| browser::SessionEnding();
|
| }
|
|
|
| -void BrowserFrameWin::OnInitMenuPopup(HMENU menu, UINT position,
|
| - BOOL is_system_menu) {
|
| +void BrowserFrameWin::HandleInitMenuPopup() {
|
| system_menu_->UpdateStates();
|
| }
|
|
|
| -void BrowserFrameWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
|
| - NativeWidgetWin::OnWindowPosChanged(window_pos);
|
| - UpdateDWMFrame();
|
| -
|
| +void BrowserFrameWin::HandleVisibilityChanged(bool visible) {
|
| // Windows lies to us about the position of the minimize button before a
|
| // window is visible. We use this position to place the OTR avatar in RTL
|
| // mode, so when the window is shown, we need to re-layout and schedule a
|
| @@ -219,12 +215,17 @@
|
| // this flag unless necessary to avoid flicker.
|
| // This may be invoked during creation on XP and before the non_client_view
|
| // has been created.
|
| - if (window_pos->flags & SWP_SHOWWINDOW && GetWidget()->non_client_view()) {
|
| + if (visible && GetWidget()->non_client_view()) {
|
| + UpdateDWMFrame();
|
| GetWidget()->non_client_view()->Layout();
|
| GetWidget()->non_client_view()->SchedulePaint();
|
| }
|
| }
|
|
|
| +void BrowserFrameWin::HandleFrameChanged() {
|
| + UpdateDWMFrame();
|
| +}
|
| +
|
| void BrowserFrameWin::OnScreenReaderDetected() {
|
| BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected();
|
| NativeWidgetWin::OnScreenReaderDetected();
|
| @@ -269,10 +270,9 @@
|
| views::NativeWidgetWin::Close();
|
| }
|
|
|
| -void BrowserFrameWin::OnActivate(UINT action, BOOL minimized, HWND window) {
|
| - if (action != WA_INACTIVE)
|
| +void BrowserFrameWin::HandleActivationChanged(bool active) {
|
| + if (active)
|
| CacheMinimizeButtonDelta();
|
| - views::NativeWidgetWin::OnActivate(action, minimized, window);
|
| }
|
|
|
| void BrowserFrameWin::FrameTypeChanged() {
|
| @@ -346,7 +346,7 @@
|
| DCHECK(cached_minimize_button_x_delta_);
|
|
|
| RECT client_rect = {0};
|
| - GetClientRect(&client_rect);
|
| + GetClientRect(GetNativeView(), &client_rect);
|
|
|
| if (base::i18n::IsRTL())
|
| return cached_minimize_button_x_delta_;
|
| @@ -371,9 +371,10 @@
|
| flip_window_fn();
|
| }
|
|
|
| -LRESULT BrowserFrameWin::OnWndProc(UINT message,
|
| - WPARAM w_param,
|
| - LPARAM l_param) {
|
| +bool BrowserFrameWin::HandleMSG(UINT message,
|
| + WPARAM w_param,
|
| + LPARAM l_param,
|
| + LRESULT* result) {
|
| static const UINT metro_navigation_search_message =
|
| RegisterWindowMessage(chrome::kMetroNavigationAndSearchMessage);
|
|
|
| @@ -396,9 +397,10 @@
|
| client_rect.bottom - client_rect.top, src_dc, 0, 0,
|
| SRCCOPY);
|
| ::ReleaseDC(GetNativeView(), src_dc);
|
| - return 0;
|
| + *result = 0;
|
| + return true;
|
| }
|
| - return views::NativeWidgetWin::OnWndProc(message, w_param, l_param);
|
| + return false;
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| @@ -579,7 +581,7 @@
|
| return;
|
|
|
| RECT rect = {0};
|
| - GetClientRect(&rect);
|
| + GetClientRect(GetNativeView(), &rect);
|
| // Calculate and cache the value of the minimize button delta, i.e. the
|
| // offset to be applied to the left or right edge of the client rect
|
| // depending on whether the language is RTL or not.
|
|
|