OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/bubble/bubble_frame_view.h" | 5 #include "ui/views/bubble/bubble_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { | 249 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { |
250 if (sender == close_) | 250 if (sender == close_) |
251 GetWidget()->Close(); | 251 GetWidget()->Close(); |
252 } | 252 } |
253 | 253 |
254 void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) { | 254 void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) { |
255 bubble_border_ = border.get(); | 255 bubble_border_ = border.get(); |
256 SetBorder(border.PassAs<Border>()); | 256 SetBorder(border.Pass()); |
257 | 257 |
258 // Update the background, which relies on the border. | 258 // Update the background, which relies on the border. |
259 set_background(new views::BubbleBackground(bubble_border_)); | 259 set_background(new views::BubbleBackground(bubble_border_)); |
260 } | 260 } |
261 | 261 |
262 void BubbleFrameView::SetTitlebarExtraView(View* view) { | 262 void BubbleFrameView::SetTitlebarExtraView(View* view) { |
263 DCHECK(view); | 263 DCHECK(view); |
264 DCHECK(!titlebar_extra_view_); | 264 DCHECK(!titlebar_extra_view_); |
265 AddChildView(view); | 265 AddChildView(view); |
266 titlebar_extra_view_ = view; | 266 titlebar_extra_view_ = view; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 if (titlebar_extra_view_ != NULL) | 378 if (titlebar_extra_view_ != NULL) |
379 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); | 379 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); |
380 gfx::Size size(client_size); | 380 gfx::Size size(client_size); |
381 size.SetToMax(gfx::Size(title_bar_width, 0)); | 381 size.SetToMax(gfx::Size(title_bar_width, 0)); |
382 const gfx::Insets insets(GetInsets()); | 382 const gfx::Insets insets(GetInsets()); |
383 size.Enlarge(insets.width(), insets.height()); | 383 size.Enlarge(insets.width(), insets.height()); |
384 return size; | 384 return size; |
385 } | 385 } |
386 | 386 |
387 } // namespace views | 387 } // namespace views |
OLD | NEW |