| 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/message_center/message_center_bubble.h" | 5 #include "ui/message_center/message_center_bubble.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 bubble_(bubble) { | 358 bubble_(bubble) { |
| 359 int between_child = UseNewDesign() ? 0 : 1; | 359 int between_child = UseNewDesign() ? 0 : 1; |
| 360 SetLayoutManager( | 360 SetLayoutManager( |
| 361 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, between_child)); | 361 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, between_child)); |
| 362 | 362 |
| 363 scroll_content_ = new ScrollContentView; | 363 scroll_content_ = new ScrollContentView; |
| 364 scroller_ = new FixedSizedScrollView; | 364 scroller_ = new FixedSizedScrollView; |
| 365 scroller_->SetContents(scroll_content_); | 365 scroller_->SetContents(scroll_content_); |
| 366 AddChildView(scroller_); | 366 AddChildView(scroller_); |
| 367 | 367 |
| 368 scroller_->SetPaintToLayer(true); | 368 if (get_use_acceleration_when_possible()) { |
| 369 scroller_->SetFillsBoundsOpaquely(false); | 369 scroller_->SetPaintToLayer(true); |
| 370 scroller_->layer()->SetMasksToBounds(true); | 370 scroller_->SetFillsBoundsOpaquely(false); |
| 371 scroller_->layer()->SetMasksToBounds(true); |
| 372 } |
| 371 | 373 |
| 372 if (UseNewDesign()) | 374 if (UseNewDesign()) |
| 373 button_view_ = new WebNotificationButtonView2(list_delegate); | 375 button_view_ = new WebNotificationButtonView2(list_delegate); |
| 374 else | 376 else |
| 375 button_view_ = new WebNotificationButtonView(list_delegate); | 377 button_view_ = new WebNotificationButtonView(list_delegate); |
| 376 AddChildView(button_view_); | 378 AddChildView(button_view_); |
| 377 } | 379 } |
| 378 | 380 |
| 379 void FocusContents() { | 381 void FocusContents() { |
| 380 scroller_->RequestFocus(); | 382 scroller_->RequestFocus(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 } | 507 } |
| 506 | 508 |
| 507 void MessageCenterBubble::OnMouseExitedView() { | 509 void MessageCenterBubble::OnMouseExitedView() { |
| 508 } | 510 } |
| 509 | 511 |
| 510 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 512 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
| 511 return contents_view_->NumMessageViews(); | 513 return contents_view_->NumMessageViews(); |
| 512 } | 514 } |
| 513 | 515 |
| 514 } // namespace message_center | 516 } // namespace message_center |
| OLD | NEW |