OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 324 } |
325 | 325 |
326 void RenderWidgetHostViewWin::DidBecomeSelected() { | 326 void RenderWidgetHostViewWin::DidBecomeSelected() { |
327 if (!is_hidden_) | 327 if (!is_hidden_) |
328 return; | 328 return; |
329 | 329 |
330 if (tab_switch_paint_time_.is_null()) | 330 if (tab_switch_paint_time_.is_null()) |
331 tab_switch_paint_time_ = TimeTicks::Now(); | 331 tab_switch_paint_time_ = TimeTicks::Now(); |
332 is_hidden_ = false; | 332 is_hidden_ = false; |
333 EnsureTooltip(); | 333 EnsureTooltip(); |
334 render_widget_host_->WasRestored(); | 334 |
| 335 // |render_widget_host_| may be NULL if the TabContents is in the process of |
| 336 // closing. |
| 337 if (render_widget_host_) |
| 338 render_widget_host_->WasRestored(); |
335 } | 339 } |
336 | 340 |
337 void RenderWidgetHostViewWin::WasHidden() { | 341 void RenderWidgetHostViewWin::WasHidden() { |
338 if (is_hidden_) | 342 if (is_hidden_) |
339 return; | 343 return; |
340 | 344 |
341 // If we receive any more paint messages while we are hidden, we want to | 345 // If we receive any more paint messages while we are hidden, we want to |
342 // ignore them so we don't re-allocate the backing store. We will paint | 346 // ignore them so we don't re-allocate the backing store. We will paint |
343 // everything again when we become selected again. | 347 // everything again when we become selected again. |
344 is_hidden_ = true; | 348 is_hidden_ = true; |
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 | 2018 |
2015 if (message == WM_MOUSEMOVE) { | 2019 if (message == WM_MOUSEMOVE) { |
2016 CPoint center = GetClientCenter(); | 2020 CPoint center = GetClientCenter(); |
2017 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). | 2021 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). |
2018 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) | 2022 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) |
2019 return; | 2023 return; |
2020 } | 2024 } |
2021 | 2025 |
2022 ForwardMouseEventToRenderer(message, wparam, lparam); | 2026 ForwardMouseEventToRenderer(message, wparam, lparam); |
2023 } | 2027 } |
OLD | NEW |