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

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

Issue 140064: Revert :... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months 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 | Annotate | Revision Log
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/widget_win.h" 9 #include "views/widget/widget_win.h"
10 #include "views/window/window.h" 10 #include "views/window/window.h"
11 11
12 void BrowserBubble::InitPopup() { 12 void BrowserBubble::InitPopup() {
13 gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow(); 13 gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow();
14 views::WidgetWin* pop = new views::WidgetWin(); 14 views::WidgetWin* pop = new views::WidgetWin();
15 pop->set_delete_on_destroy(false); 15 pop->set_delete_on_destroy(false);
16 pop->set_window_style(WS_POPUP); 16 pop->set_window_style(WS_POPUP);
17 #if 0 17 #if 0
18 // TODO(erikkay) Layered windows don't draw child windows. 18 // TODO(erikkay) Layered windows don't draw child windows.
19 // Apparently there's some tricks you can do to handle that. 19 // Apparently there's some tricks you can do to handle that.
20 // Do the research so we can use this. 20 // Do the research so we can use this.
21 pop->set_window_ex_style(WS_EX_LAYERED | 21 pop->set_window_ex_style(WS_EX_LAYERED |
22 l10n_util::GetExtendedTooltipStyles()); 22 l10n_util::GetExtendedTooltipStyles());
23 pop->SetOpacity(0xFF); 23 pop->SetOpacity(0xFF);
24 #endif 24 #endif
25 // A focus manager is necessary if you want to be able to handle various 25 // A focus manager is necessary if you want to be able to handle various
26 // mouse events properly. 26 // mouse events properly.
27 pop->Init(frame_native_view_, bounds_); 27 pop->Init(frame_native_view_,
28 bounds_,
29 true); // Give the widget a focus manager.
28 pop->SetContentsView(view_); 30 pop->SetContentsView(view_);
29 popup_.reset(pop); 31 popup_.reset(pop);
30 Reposition(); 32 Reposition();
31 33
32 AttachToBrowser(); 34 AttachToBrowser();
33 } 35 }
34 36
35 void BrowserBubble::MovePopup(int x, int y, int w, int h) { 37 void BrowserBubble::MovePopup(int x, int y, int w, int h) {
36 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get()); 38 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get());
37 pop->MoveWindow(x, y, w, h); 39 pop->MoveWindow(x, y, w, h);
38 } 40 }
39 41
40 void BrowserBubble::Show() { 42 void BrowserBubble::Show() {
41 if (visible_) 43 if (visible_)
42 return; 44 return;
43 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get()); 45 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get());
44 pop->Show(); 46 pop->Show();
45 visible_ = true; 47 visible_ = true;
46 } 48 }
47 49
48 void BrowserBubble::Hide() { 50 void BrowserBubble::Hide() {
49 if (!visible_) 51 if (!visible_)
50 return; 52 return;
51 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get()); 53 views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get());
52 pop->Hide(); 54 pop->Hide();
53 visible_ = false; 55 visible_ = false;
54 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_bubble_view.cc ('k') | chrome/browser/views/constrained_window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698