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

Side by Side Diff: chrome/browser/ui/views/bubble/border_widget_win.cc

Issue 8761012: Remove the old views bubble code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync. Created 9 years 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/bubble/border_widget_win.h"
6
7 #include <windows.h>
8
9 #include "chrome/browser/ui/views/bubble/border_contents.h"
10 #include "ui/views/widget/widget.h"
11
12 BorderWidgetWin::BorderWidgetWin()
13 : views::NativeWidgetWin(new views::Widget),
14 border_contents_(NULL) {
15 }
16
17 void BorderWidgetWin::InitBorderWidgetWin(BorderContents* border_contents,
18 HWND owner) {
19 DCHECK(!border_contents_);
20 border_contents_ = border_contents;
21 border_contents_->Init();
22
23 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
24 params.transparent = true;
25 params.parent = owner;
26 params.native_widget = this;
27 GetWidget()->Init(params);
28 GetWidget()->SetContentsView(border_contents_);
29 SetWindowPos(owner, 0, 0, 0, 0,
30 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW);
31 }
32
33 gfx::Rect BorderWidgetWin::SizeAndGetBounds(
34 const gfx::Rect& position_relative_to,
35 views::BubbleBorder::ArrowLocation arrow_location,
36 const gfx::Size& contents_size) {
37 // Ask the border view to calculate our bounds (and our contents').
38 gfx::Rect contents_bounds;
39 gfx::Rect window_bounds;
40 border_contents_->SizeAndGetBounds(position_relative_to, arrow_location,
41 false, contents_size, &contents_bounds,
42 &window_bounds);
43 GetWidget()->SetBounds(window_bounds);
44
45 // Return |contents_bounds| in screen coordinates.
46 contents_bounds.Offset(window_bounds.origin());
47 return contents_bounds;
48 }
49
50 LRESULT BorderWidgetWin::OnMouseActivate(UINT message,
51 WPARAM w_param,
52 LPARAM l_param) {
53 // Never activate.
54 return MA_NOACTIVATE;
55 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bubble/border_widget_win.h ('k') | chrome/browser/ui/views/bubble/bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698