Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Side by Side Diff: chrome/browser/ui/views/hung_renderer_view.cc

Issue 7054052: Move more from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/infobars/after_translate_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698