| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 // If we receive any more paint messages while we are hidden, we want to | 341 // 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 | 342 // ignore them so we don't re-allocate the backing store. We will paint |
| 343 // everything again when we become selected again. | 343 // everything again when we become selected again. |
| 344 is_hidden_ = true; | 344 is_hidden_ = true; |
| 345 | 345 |
| 346 ResetTooltip(); | 346 ResetTooltip(); |
| 347 | 347 |
| 348 // If we have a renderer, then inform it that we are being hidden so it can | 348 // If we have a renderer, then inform it that we are being hidden so it can |
| 349 // reduce its resource utilization. | 349 // reduce its resource utilization. |
| 350 render_widget_host_->WasHidden(); | 350 if (render_widget_host_) |
| 351 render_widget_host_->WasHidden(); |
| 351 } | 352 } |
| 352 | 353 |
| 353 void RenderWidgetHostViewWin::SetSize(const gfx::Size& size) { | 354 void RenderWidgetHostViewWin::SetSize(const gfx::Size& size) { |
| 354 SetBounds(gfx::Rect(GetViewBounds().origin(), size)); | 355 SetBounds(gfx::Rect(GetViewBounds().origin(), size)); |
| 355 } | 356 } |
| 356 | 357 |
| 357 void RenderWidgetHostViewWin::SetBounds(const gfx::Rect& rect) { | 358 void RenderWidgetHostViewWin::SetBounds(const gfx::Rect& rect) { |
| 358 if (is_hidden_) | 359 if (is_hidden_) |
| 359 return; | 360 return; |
| 360 | 361 |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2014 | 2015 |
| 2015 if (message == WM_MOUSEMOVE) { | 2016 if (message == WM_MOUSEMOVE) { |
| 2016 CPoint center = GetClientCenter(); | 2017 CPoint center = GetClientCenter(); |
| 2017 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). | 2018 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). |
| 2018 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) | 2019 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) |
| 2019 return; | 2020 return; |
| 2020 } | 2021 } |
| 2021 | 2022 |
| 2022 ForwardMouseEventToRenderer(message, wparam, lparam); | 2023 ForwardMouseEventToRenderer(message, wparam, lparam); |
| 2023 } | 2024 } |
| OLD | NEW |