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

Side by Side Diff: ui/message_center/views/toast_contents_view.cc

Issue 293833002: Fix Widget::InitParams::activatable logic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/views/toast_contents_view.h ('k') | ui/views/widget/widget.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/views/toast_contents_view.h" 5 #include "ui/message_center/views/toast_contents_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // views::WidgetDelegate 227 // views::WidgetDelegate
228 views::View* ToastContentsView::GetContentsView() { 228 views::View* ToastContentsView::GetContentsView() {
229 return this; 229 return this;
230 } 230 }
231 231
232 void ToastContentsView::WindowClosing() { 232 void ToastContentsView::WindowClosing() {
233 if (!is_closing_ && collection_.get()) 233 if (!is_closing_ && collection_.get())
234 collection_->ForgetToast(this); 234 collection_->ForgetToast(this);
235 } 235 }
236 236
237 bool ToastContentsView::CanActivate() const {
238 return false;
239 }
240
241 void ToastContentsView::OnDisplayChanged() { 237 void ToastContentsView::OnDisplayChanged() {
242 views::Widget* widget = GetWidget(); 238 views::Widget* widget = GetWidget();
243 if (!widget) 239 if (!widget)
244 return; 240 return;
245 241
246 gfx::NativeView native_view = widget->GetNativeView(); 242 gfx::NativeView native_view = widget->GetNativeView();
247 if (!native_view || !collection_.get()) 243 if (!native_view || !collection_.get())
248 return; 244 return;
249 245
250 collection_->OnDisplayBoundsChanged(gfx::Screen::GetScreenFor( 246 collection_->OnDisplayBoundsChanged(gfx::Screen::GetScreenFor(
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 348 }
353 349
354 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { 350 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) {
355 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, 351 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth,
356 bounds.y(), 352 bounds.y(),
357 kClosedToastWidth, 353 kClosedToastWidth,
358 bounds.height()); 354 bounds.height());
359 } 355 }
360 356
361 } // namespace message_center 357 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/toast_contents_view.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698