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

Side by Side Diff: ui/message_center/quiet_mode_bubble.cc

Issue 11836003: Allow message center and related bubbles to render on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move comment and early return instead of big blocks. Created 7 years, 11 months 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
« no previous file with comments | « ui/message_center/message_popup_bubble.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/message_center/quiet_mode_bubble.h" 4 #include "ui/message_center/quiet_mode_bubble.h"
5 5
6 #include "base/time.h" 6 #include "base/time.h"
7 #include "grit/ui_strings.h" 7 #include "grit/ui_strings.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/gfx/insets.h" 10 #include "ui/gfx/insets.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 namespace message_center { 48 namespace message_center {
49 49
50 QuietModeBubble::QuietModeBubble(views::View* anchor_view, 50 QuietModeBubble::QuietModeBubble(views::View* anchor_view,
51 gfx::NativeView parent_window, 51 gfx::NativeView parent_window,
52 NotificationList* notification_list) 52 NotificationList* notification_list)
53 : notification_list_(notification_list) { 53 : notification_list_(notification_list) {
54 DCHECK(notification_list_); 54 DCHECK(notification_list_);
55 bubble_ = new views::BubbleDelegateView( 55 bubble_ = new views::BubbleDelegateView(
56 anchor_view, views::BubbleBorder::BOTTOM_RIGHT); 56 anchor_view, views::BubbleBorder::BOTTOM_RIGHT);
57 bubble_->set_notify_enter_exit_on_child(true); 57 bubble_->set_notify_enter_exit_on_child(true);
58 bubble_->SetPaintToLayer(true); 58
59 bubble_->SetFillsBoundsOpaquely(true); 59 if (views::View::get_use_acceleration_when_possible()) {
60 bubble_->SetPaintToLayer(true);
61 bubble_->SetFillsBoundsOpaquely(true);
62 }
63
60 bubble_->set_parent_window(parent_window); 64 bubble_->set_parent_window(parent_window);
61 bubble_->set_margins(gfx::Insets()); 65 bubble_->set_margins(gfx::Insets());
62 InitializeBubbleContents(); 66 InitializeBubbleContents();
63 views::BubbleDelegateView::CreateBubble(bubble_); 67 views::BubbleDelegateView::CreateBubble(bubble_);
64 bubble_->Show(); 68 bubble_->Show();
65 } 69 }
66 70
67 QuietModeBubble::~QuietModeBubble() { 71 QuietModeBubble::~QuietModeBubble() {
68 Close(); 72 Close();
69 } 73 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 LOG(INFO) << notification_list_->quiet_mode(); 112 LOG(INFO) << notification_list_->quiet_mode();
109 } else { 113 } else {
110 base::TimeDelta expires_in = (sender == quiet_mode_1day_) ? 114 base::TimeDelta expires_in = (sender == quiet_mode_1day_) ?
111 base::TimeDelta::FromDays(1) : base::TimeDelta::FromHours(1); 115 base::TimeDelta::FromDays(1) : base::TimeDelta::FromHours(1);
112 notification_list_->EnterQuietModeWithExpire(expires_in); 116 notification_list_->EnterQuietModeWithExpire(expires_in);
113 } 117 }
114 Close(); 118 Close();
115 } 119 }
116 120
117 } // namespace message_center 121 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/message_popup_bubble.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698