| 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 // Draws the view for the balloons. | 5 // Draws the view for the balloons. |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/notifications/notification_panel.h" | 7 #include "chrome/browser/chromeos/notifications/notification_panel.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 419 } |
| 420 | 420 |
| 421 //////////////////////////////////////////////////////////////////////////////// | 421 //////////////////////////////////////////////////////////////////////////////// |
| 422 // NottificationPanel public. | 422 // NottificationPanel public. |
| 423 | 423 |
| 424 void NotificationPanel::Show() { | 424 void NotificationPanel::Show() { |
| 425 if (!panel_widget_) { | 425 if (!panel_widget_) { |
| 426 panel_widget_ = new views::Widget; | 426 panel_widget_ = new views::Widget; |
| 427 // TODO(oshima): Using window because Popup widget behaves weird | 427 // TODO(oshima): Using window because Popup widget behaves weird |
| 428 // when resizing. This needs to be investigated. | 428 // when resizing. This needs to be investigated. |
| 429 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); | 429 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 430 // Enable double buffering because the panel has both pure views | 430 // Enable double buffering because the panel has both pure views |
| 431 // control and native controls (scroll bar). | 431 // control and native controls (scroll bar). |
| 432 params.double_buffer = true; | 432 params.double_buffer = true; |
| 433 | 433 |
| 434 gfx::Rect bounds = GetPreferredBounds(); | 434 gfx::Rect bounds = GetPreferredBounds(); |
| 435 bounds = bounds.Union(min_bounds_); | 435 bounds = bounds.Union(min_bounds_); |
| 436 params.bounds = bounds; | 436 params.bounds = bounds; |
| 437 panel_widget_->Init(params); | 437 panel_widget_->Init(params); |
| 438 // Set minimum bounds so that it can grow freely. | 438 // Set minimum bounds so that it can grow freely. |
| 439 gtk_widget_set_size_request(GTK_WIDGET(panel_widget_->GetNativeView()), | 439 gtk_widget_set_size_request(GTK_WIDGET(panel_widget_->GetNativeView()), |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 &origin); | 856 &origin); |
| 857 return rect.Contains(gfx::Rect(origin, view->size())); | 857 return rect.Contains(gfx::Rect(origin, view->size())); |
| 858 } | 858 } |
| 859 | 859 |
| 860 | 860 |
| 861 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { | 861 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { |
| 862 return panel_->active_ == view; | 862 return panel_->active_ == view; |
| 863 } | 863 } |
| 864 | 864 |
| 865 } // namespace chromeos | 865 } // namespace chromeos |
| OLD | NEW |