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 "chrome/browser/ui/browser_dialogs.h" | 5 #include "chrome/browser/ui/browser_dialogs.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 layout->StartRow(0, single_column_set_id); | 440 layout->StartRow(0, single_column_set_id); |
441 layout->AddView(kill_button_); | 441 layout->AddView(kill_button_); |
442 } | 442 } |
443 | 443 |
444 gfx::Rect HungRendererDialogView::GetDisplayBounds( | 444 gfx::Rect HungRendererDialogView::GetDisplayBounds( |
445 TabContents* contents) { | 445 TabContents* contents) { |
446 HWND contents_hwnd = contents->GetNativeView(); | 446 HWND contents_hwnd = contents->GetNativeView(); |
447 RECT contents_bounds_rect; | 447 RECT contents_bounds_rect; |
448 GetWindowRect(contents_hwnd, &contents_bounds_rect); | 448 GetWindowRect(contents_hwnd, &contents_bounds_rect); |
449 gfx::Rect contents_bounds(contents_bounds_rect); | 449 gfx::Rect contents_bounds(contents_bounds_rect); |
450 gfx::Rect window_bounds = window()->GetBounds(); | 450 gfx::Rect window_bounds = window()->GetWindowScreenBounds(); |
451 | 451 |
452 int window_x = contents_bounds.x() + | 452 int window_x = contents_bounds.x() + |
453 (contents_bounds.width() - window_bounds.width()) / 2; | 453 (contents_bounds.width() - window_bounds.width()) / 2; |
454 int window_y = contents_bounds.y() + kOverlayContentsOffsetY; | 454 int window_y = contents_bounds.y() + kOverlayContentsOffsetY; |
455 return gfx::Rect(window_x, window_y, window_bounds.width(), | 455 return gfx::Rect(window_x, window_y, window_bounds.width(), |
456 window_bounds.height()); | 456 window_bounds.height()); |
457 } | 457 } |
458 | 458 |
459 // static | 459 // static |
460 void HungRendererDialogView::InitClass() { | 460 void HungRendererDialogView::InitClass() { |
(...skipping 20 matching lines...) Expand all Loading... |
481 g_instance->ShowForTabContents(contents); | 481 g_instance->ShowForTabContents(contents); |
482 } | 482 } |
483 } | 483 } |
484 | 484 |
485 void HideHungRendererDialog(TabContents* contents) { | 485 void HideHungRendererDialog(TabContents* contents) { |
486 if (!logging::DialogsAreSuppressed() && g_instance) | 486 if (!logging::DialogsAreSuppressed() && g_instance) |
487 g_instance->EndForTabContents(contents); | 487 g_instance->EndForTabContents(contents); |
488 } | 488 } |
489 | 489 |
490 } // namespace browser | 490 } // namespace browser |
OLD | NEW |