| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 635 |
| 636 void BrowserView::FlashFrame(bool flash) { | 636 void BrowserView::FlashFrame(bool flash) { |
| 637 frame_->FlashFrame(flash); | 637 frame_->FlashFrame(flash); |
| 638 } | 638 } |
| 639 | 639 |
| 640 bool BrowserView::IsAlwaysOnTop() const { | 640 bool BrowserView::IsAlwaysOnTop() const { |
| 641 return false; | 641 return false; |
| 642 } | 642 } |
| 643 | 643 |
| 644 gfx::NativeWindow BrowserView::GetNativeWindow() { | 644 gfx::NativeWindow BrowserView::GetNativeWindow() { |
| 645 // While the browser destruction is going on, the widget can already be gone, |
| 646 // but utility functions like FindBrowserWithWindow will come here and crash. |
| 647 // We short circuit therefore. |
| 648 if (!GetWidget()) |
| 649 return NULL; |
| 645 return GetWidget()->GetTopLevelWidget()->GetNativeWindow(); | 650 return GetWidget()->GetTopLevelWidget()->GetNativeWindow(); |
| 646 } | 651 } |
| 647 | 652 |
| 648 BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() { | 653 BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() { |
| 649 return this; | 654 return this; |
| 650 } | 655 } |
| 651 | 656 |
| 652 StatusBubble* BrowserView::GetStatusBubble() { | 657 StatusBubble* BrowserView::GetStatusBubble() { |
| 653 return status_bubble_.get(); | 658 return status_bubble_.get(); |
| 654 } | 659 } |
| (...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2603 | 2608 |
| 2604 Browser* modal_browser = | 2609 Browser* modal_browser = |
| 2605 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); | 2610 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); |
| 2606 if (modal_browser && (browser_ != modal_browser)) { | 2611 if (modal_browser && (browser_ != modal_browser)) { |
| 2607 modal_browser->window()->FlashFrame(true); | 2612 modal_browser->window()->FlashFrame(true); |
| 2608 modal_browser->window()->Activate(); | 2613 modal_browser->window()->Activate(); |
| 2609 } | 2614 } |
| 2610 | 2615 |
| 2611 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2616 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
| 2612 } | 2617 } |
| OLD | NEW |