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

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

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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) 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, 541 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0,
542 GridLayout::USE_PREF, 0, 0); 542 GridLayout::USE_PREF, 0, 0);
543 543
544 layout->StartRow(0, single_column_set_id); 544 layout->StartRow(0, single_column_set_id);
545 layout->AddView(kill_button_); 545 layout->AddView(kill_button_);
546 } 546 }
547 547
548 gfx::Rect HungRendererDialogView::GetDisplayBounds( 548 gfx::Rect HungRendererDialogView::GetDisplayBounds(
549 WebContents* contents) { 549 WebContents* contents) {
550 #if defined(USE_AURA) 550 #if defined(USE_AURA)
551 gfx::Rect contents_bounds(contents->GetNativeView()->GetRootWindowBounds()); 551 gfx::Rect contents_bounds(contents->GetNativeView()->GetBoundsInRootWindow());
552 #elif defined(OS_WIN) 552 #elif defined(OS_WIN)
553 HWND contents_hwnd = contents->GetNativeView(); 553 HWND contents_hwnd = contents->GetNativeView();
554 RECT contents_bounds_rect; 554 RECT contents_bounds_rect;
555 GetWindowRect(contents_hwnd, &contents_bounds_rect); 555 GetWindowRect(contents_hwnd, &contents_bounds_rect);
556 gfx::Rect contents_bounds(contents_bounds_rect); 556 gfx::Rect contents_bounds(contents_bounds_rect);
557 #endif 557 #endif
558 gfx::Rect window_bounds = GetWidget()->GetWindowScreenBounds(); 558 gfx::Rect window_bounds = GetWidget()->GetWindowBoundsInScreen();
559 559
560 int window_x = contents_bounds.x() + 560 int window_x = contents_bounds.x() +
561 (contents_bounds.width() - window_bounds.width()) / 2; 561 (contents_bounds.width() - window_bounds.width()) / 2;
562 int window_y = contents_bounds.y() + kOverlayContentsOffsetY; 562 int window_y = contents_bounds.y() + kOverlayContentsOffsetY;
563 return gfx::Rect(window_x, window_y, window_bounds.width(), 563 return gfx::Rect(window_x, window_y, window_bounds.width(),
564 window_bounds.height()); 564 window_bounds.height());
565 } 565 }
566 566
567 // static 567 // static
568 void HungRendererDialogView::InitClass() { 568 void HungRendererDialogView::InitClass() {
(...skipping 20 matching lines...) Expand all
589 g_instance->ShowForWebContents(contents); 589 g_instance->ShowForWebContents(contents);
590 } 590 }
591 } 591 }
592 592
593 void HideHungRendererDialog(WebContents* contents) { 593 void HideHungRendererDialog(WebContents* contents) {
594 if (!logging::DialogsAreSuppressed() && g_instance) 594 if (!logging::DialogsAreSuppressed() && g_instance)
595 g_instance->EndForWebContents(contents); 595 g_instance->EndForWebContents(contents);
596 } 596 }
597 597
598 } // namespace chrome 598 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/notifications/balloon_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698