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/views/browser_bubble.h" | 5 #include "chrome/browser/views/browser_bubble.h" |
6 | 6 |
7 #include "app/l10n_util_win.h" | 7 #include "app/l10n_util_win.h" |
8 #include "chrome/browser/views/frame/browser_view.h" | 8 #include "chrome/browser/views/frame/browser_view.h" |
9 #include "views/widget/root_view.h" | 9 #include "views/widget/root_view.h" |
10 #include "views/widget/widget_win.h" | 10 #include "views/widget/widget_win.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (!delegate) { | 51 if (!delegate) { |
52 if (action == WA_INACTIVE && !closed_) { | 52 if (action == WA_INACTIVE && !closed_) { |
53 bubble_->DetachFromBrowser(); | 53 bubble_->DetachFromBrowser(); |
54 delete bubble_; | 54 delete bubble_; |
55 } | 55 } |
56 return; | 56 return; |
57 } | 57 } |
58 | 58 |
59 if (action == WA_INACTIVE && !closed_) { | 59 if (action == WA_INACTIVE && !closed_) { |
60 delegate->BubbleLostFocus(bubble_); | 60 delegate->BubbleLostFocus(bubble_); |
61 } else if (action == WA_ACTIVE) { | 61 } |
| 62 } |
| 63 |
| 64 virtual void OnSetFocus(HWND focused_window) { |
| 65 BrowserBubble::Delegate* delegate = bubble_->delegate(); |
| 66 if (delegate) |
62 delegate->BubbleGotFocus(bubble_); | 67 delegate->BubbleGotFocus(bubble_); |
63 } | |
64 } | 68 } |
65 | 69 |
66 private: | 70 private: |
67 bool closed_; | 71 bool closed_; |
68 BrowserBubble* bubble_; | 72 BrowserBubble* bubble_; |
69 }; | 73 }; |
70 | 74 |
71 void BrowserBubble::InitPopup() { | 75 void BrowserBubble::InitPopup() { |
72 // popup_ is a Widget, but we need to do some WidgetWin stuff first, then | 76 // popup_ is a Widget, but we need to do some WidgetWin stuff first, then |
73 // we'll assign it into popup_. | 77 // we'll assign it into popup_. |
(...skipping 19 matching lines...) Expand all Loading... |
93 visible_ = true; | 97 visible_ = true; |
94 } | 98 } |
95 | 99 |
96 void BrowserBubble::Hide() { | 100 void BrowserBubble::Hide() { |
97 if (!visible_) | 101 if (!visible_) |
98 return; | 102 return; |
99 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); | 103 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); |
100 pop->Hide(); | 104 pop->Hide(); |
101 visible_ = false; | 105 visible_ = false; |
102 } | 106 } |
OLD | NEW |