OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/ui/views/browser_bubble.h" | 5 #include "chrome/browser/ui/views/browser_bubble.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "chrome/browser/ui/views/bubble/border_contents.h" | 9 #include "chrome/browser/ui/views/bubble/border_contents.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(BubbleWidget); | 89 DISALLOW_COPY_AND_ASSIGN(BubbleWidget); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 void BrowserBubble::InitPopup(const gfx::Insets& content_margins) { | 94 void BrowserBubble::InitPopup(const gfx::Insets& content_margins) { |
95 // TODO(port) | 95 // TODO(port) |
96 BubbleWidget* bubble_widget = new BubbleWidget(this, content_margins); | 96 BubbleWidget* bubble_widget = new BubbleWidget(this, content_margins); |
97 popup_ = bubble_widget->GetWidget(); | 97 popup_ = bubble_widget->GetWidget(); |
98 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 98 views::Widget::InitParams params( |
| 99 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
99 params.transparent = true; | 100 params.transparent = true; |
100 params.parent = frame_->GetNativeView(); | 101 params.parent = frame_->GetNativeView(); |
101 params.native_widget = bubble_widget; | 102 params.native_widget = bubble_widget; |
102 popup_->Init(params); | 103 popup_->Init(params); |
103 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
104 { | 105 { |
105 vector<int> params; | 106 vector<int> params; |
106 params.push_back(0); // don't show while screen is locked | 107 params.push_back(0); // don't show while screen is locked |
107 chromeos::WmIpc::instance()->SetWindowType( | 108 chromeos::WmIpc::instance()->SetWindowType( |
108 popup_->GetNativeView(), | 109 popup_->GetNativeView(), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 gfx::Rect contents_bounds; | 150 gfx::Rect contents_bounds; |
150 border_contents->SizeAndGetBounds(GetAbsoluteRelativeTo(), | 151 border_contents->SizeAndGetBounds(GetAbsoluteRelativeTo(), |
151 arrow_location_, false, view_->size(), | 152 arrow_location_, false, view_->size(), |
152 &contents_bounds, &window_bounds); | 153 &contents_bounds, &window_bounds); |
153 | 154 |
154 border_contents->SetBoundsRect(gfx::Rect(gfx::Point(), window_bounds.size())); | 155 border_contents->SetBoundsRect(gfx::Rect(gfx::Point(), window_bounds.size())); |
155 view_->SetBoundsRect(contents_bounds); | 156 view_->SetBoundsRect(contents_bounds); |
156 | 157 |
157 SetAbsoluteBounds(window_bounds); | 158 SetAbsoluteBounds(window_bounds); |
158 } | 159 } |
OLD | NEW |