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

Side by Side Diff: chrome/browser/views/browser_bubble_win.cc

Issue 347016: Implement page action popups. (Closed)
Patch Set: fixed failing test Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/location_bar.h ('k') | chrome/browser/views/location_bar_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
39 if (IsActive()) { 39 if (IsActive()) {
40 BrowserBubble::Delegate* delegate = bubble_->delegate(); 40 BrowserBubble::Delegate* delegate = bubble_->delegate();
41 if (delegate) 41 if (delegate)
42 delegate->BubbleLostFocus(bubble_); 42 delegate->BubbleLostFocus(bubble_);
43 } 43 }
44 views::WidgetWin::Hide(); 44 views::WidgetWin::Hide();
45 } 45 }
46 46
47 void OnActivate(UINT action, BOOL minimized, HWND window) { 47 void OnActivate(UINT action, BOOL minimized, HWND window) {
48 BrowserBubble::Delegate* delegate = bubble_->delegate(); 48 BrowserBubble::Delegate* delegate = bubble_->delegate();
49 if (!delegate) 49 if (!delegate) {
50 if (action == WA_INACTIVE && !closed_) {
51 bubble_->DetachFromBrowser();
52 delete bubble_;
53 }
50 return; 54 return;
55 }
51 56
52 if (action == WA_INACTIVE && !closed_) { 57 if (action == WA_INACTIVE && !closed_) {
53 delegate->BubbleLostFocus(bubble_); 58 delegate->BubbleLostFocus(bubble_);
54 } else if (action == WA_ACTIVE) { 59 } else if (action == WA_ACTIVE) {
55 delegate->BubbleGotFocus(bubble_); 60 delegate->BubbleGotFocus(bubble_);
56 } 61 }
57 } 62 }
58 63
59 private: 64 private:
60 bool closed_; 65 bool closed_;
(...skipping 26 matching lines...) Expand all
87 visible_ = true; 92 visible_ = true;
88 } 93 }
89 94
90 void BrowserBubble::Hide() { 95 void BrowserBubble::Hide() {
91 if (!visible_) 96 if (!visible_)
92 return; 97 return;
93 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); 98 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_);
94 pop->Hide(); 99 pop->Hide();
95 visible_ = false; 100 visible_ = false;
96 } 101 }
OLDNEW
« no previous file with comments | « chrome/browser/location_bar.h ('k') | chrome/browser/views/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698