| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/browser_dialogs.h" | 5 #include "chrome/browser/ui/browser_dialogs.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) && !defined(USE_AURA) | 7 #if defined(OS_WIN) && !defined(USE_AURA) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, | 528 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, |
| 529 GridLayout::USE_PREF, 0, 0); | 529 GridLayout::USE_PREF, 0, 0); |
| 530 | 530 |
| 531 layout->StartRow(0, single_column_set_id); | 531 layout->StartRow(0, single_column_set_id); |
| 532 layout->AddView(kill_button_); | 532 layout->AddView(kill_button_); |
| 533 } | 533 } |
| 534 | 534 |
| 535 gfx::Rect HungRendererDialogView::GetDisplayBounds( | 535 gfx::Rect HungRendererDialogView::GetDisplayBounds( |
| 536 WebContents* contents) { | 536 WebContents* contents) { |
| 537 #if defined(USE_AURA) | 537 #if defined(USE_AURA) |
| 538 gfx::Rect contents_bounds(contents->GetNativeView()->GetScreenBounds()); | 538 gfx::Rect contents_bounds(contents->GetNativeView()->GetBoundsInRootWindow()); |
| 539 #elif defined(OS_WIN) | 539 #elif defined(OS_WIN) |
| 540 HWND contents_hwnd = contents->GetNativeView(); | 540 HWND contents_hwnd = contents->GetNativeView(); |
| 541 RECT contents_bounds_rect; | 541 RECT contents_bounds_rect; |
| 542 GetWindowRect(contents_hwnd, &contents_bounds_rect); | 542 GetWindowRect(contents_hwnd, &contents_bounds_rect); |
| 543 gfx::Rect contents_bounds(contents_bounds_rect); | 543 gfx::Rect contents_bounds(contents_bounds_rect); |
| 544 #endif | 544 #endif |
| 545 gfx::Rect window_bounds = GetWidget()->GetWindowScreenBounds(); | 545 gfx::Rect window_bounds = GetWidget()->GetWindowScreenBounds(); |
| 546 | 546 |
| 547 int window_x = contents_bounds.x() + | 547 int window_x = contents_bounds.x() + |
| 548 (contents_bounds.width() - window_bounds.width()) / 2; | 548 (contents_bounds.width() - window_bounds.width()) / 2; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 576 g_instance->ShowForWebContents(contents); | 576 g_instance->ShowForWebContents(contents); |
| 577 } | 577 } |
| 578 } | 578 } |
| 579 | 579 |
| 580 void HideHungRendererDialog(WebContents* contents) { | 580 void HideHungRendererDialog(WebContents* contents) { |
| 581 if (!logging::DialogsAreSuppressed() && g_instance) | 581 if (!logging::DialogsAreSuppressed() && g_instance) |
| 582 g_instance->EndForWebContents(contents); | 582 g_instance->EndForWebContents(contents); |
| 583 } | 583 } |
| 584 | 584 |
| 585 } // namespace browser | 585 } // namespace browser |
| OLD | NEW |