| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extensions/extension_popup_host.h" | 5 #include "chrome/browser/extensions/extension_popup_host.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_VIEWS) | 7 #if defined(TOOLKIT_VIEWS) |
| 8 #include "chrome/browser/extensions/extension_popup_api.h" | 8 #include "chrome/browser/extensions/extension_popup_api.h" |
| 9 #endif | 9 #endif |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 DismissPopup(); | 48 DismissPopup(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void ExtensionPopupHost::BubbleBrowserWindowClosing(BrowserBubble* bubble) { | 51 void ExtensionPopupHost::BubbleBrowserWindowClosing(BrowserBubble* bubble) { |
| 52 DismissPopup(); | 52 DismissPopup(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void ExtensionPopupHost::BubbleGotFocus(BrowserBubble* bubble) { | 55 void ExtensionPopupHost::BubbleGotFocus(BrowserBubble* bubble) { |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ExtensionPopupHost::BubbleLostFocus(BrowserBubble* bubble) { | 58 void ExtensionPopupHost::BubbleLostFocus(BrowserBubble* bubble, |
| 59 gfx::NativeView focused_view) { |
| 59 // TODO(twiz): Dismiss the pop-up upon loss of focus of the bubble, but not | 60 // TODO(twiz): Dismiss the pop-up upon loss of focus of the bubble, but not |
| 60 // if the focus is transitioning to the host which owns the popup! | 61 // if the focus is transitioning to the host which owns the popup! |
| 61 // DismissPopup(); | 62 // DismissPopup(); |
| 62 } | 63 } |
| 63 #endif // defined(TOOLKIT_VIEWS) | 64 #endif // defined(TOOLKIT_VIEWS) |
| 64 | 65 |
| 65 void ExtensionPopupHost::Observe(NotificationType type, | 66 void ExtensionPopupHost::Observe(NotificationType type, |
| 66 const NotificationSource& source, | 67 const NotificationSource& source, |
| 67 const NotificationDetails& details) { | 68 const NotificationDetails& details) { |
| 68 if (type == NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE) { | 69 if (type == NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 86 child_popup_->DetachFromBrowser(); | 87 child_popup_->DetachFromBrowser(); |
| 87 delete child_popup_; | 88 delete child_popup_; |
| 88 child_popup_ = NULL; | 89 child_popup_ = NULL; |
| 89 | 90 |
| 90 PopupEventRouter::OnPopupClosed( | 91 PopupEventRouter::OnPopupClosed( |
| 91 delegate_->GetBrowser()->profile(), | 92 delegate_->GetBrowser()->profile(), |
| 92 delegate_->GetRenderViewHost()->routing_id()); | 93 delegate_->GetRenderViewHost()->routing_id()); |
| 93 } | 94 } |
| 94 #endif // defined(TOOLKIT_VIEWS) | 95 #endif // defined(TOOLKIT_VIEWS) |
| 95 } | 96 } |
| OLD | NEW |