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/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 HWND foreground_window = GetForegroundWindow(); | 329 HWND foreground_window = GetForegroundWindow(); |
330 if (foreground_window != frame_hwnd && | 330 if (foreground_window != frame_hwnd && |
331 foreground_window != GetWidget()->GetNativeWindow()) { | 331 foreground_window != GetWidget()->GetNativeWindow()) { |
332 return; | 332 return; |
333 } | 333 } |
334 | 334 |
335 if (!GetWidget()->IsActive()) { | 335 if (!GetWidget()->IsActive()) { |
336 gfx::Rect bounds = GetDisplayBounds(contents); | 336 gfx::Rect bounds = GetDisplayBounds(contents); |
337 views::Widget* insert_after = | 337 views::Widget* insert_after = |
338 views::Widget::GetWidgetForNativeView(frame_hwnd); | 338 views::Widget::GetWidgetForNativeView(frame_hwnd); |
339 GetWidget()->SetBoundsConstrained(bounds, insert_after); | 339 GetWidget()->SetBoundsConstrained(bounds); |
340 if (insert_after) | 340 if (insert_after) |
341 GetWidget()->MoveAboveWidget(insert_after); | 341 GetWidget()->MoveAboveWidget(insert_after); |
342 | 342 |
343 // We only do this if the window isn't active (i.e. hasn't been shown yet, | 343 // We only do this if the window isn't active (i.e. hasn't been shown yet, |
344 // or is currently shown but deactivated for another TabContents). This is | 344 // or is currently shown but deactivated for another TabContents). This is |
345 // because this window is a singleton, and it's possible another active | 345 // because this window is a singleton, and it's possible another active |
346 // renderer may hang while this one is showing, and we don't want to reset | 346 // renderer may hang while this one is showing, and we don't want to reset |
347 // the list of hung pages for a potentially unrelated renderer while this | 347 // the list of hung pages for a potentially unrelated renderer while this |
348 // one is showing. | 348 // one is showing. |
349 hung_pages_table_model_->InitForTabContents(contents); | 349 hung_pages_table_model_->InitForTabContents(contents); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 g_instance->ShowForTabContents(contents); | 558 g_instance->ShowForTabContents(contents); |
559 } | 559 } |
560 } | 560 } |
561 | 561 |
562 void HideNativeHungRendererDialog(TabContents* contents) { | 562 void HideNativeHungRendererDialog(TabContents* contents) { |
563 if (!logging::DialogsAreSuppressed() && g_instance) | 563 if (!logging::DialogsAreSuppressed() && g_instance) |
564 g_instance->EndForTabContents(contents); | 564 g_instance->EndForTabContents(contents); |
565 } | 565 } |
566 | 566 |
567 } // namespace browser | 567 } // namespace browser |
OLD | NEW |