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

Side by Side Diff: chrome/browser/chromeos/notifications/balloon_view.cc

Issue 4635007: When an extension is uninstalled, close all desktop notifications from that e... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/notifications/balloon_view.h" 5 #include "chrome/browser/chromeos/notifications/balloon_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/menus/simple_menu_model.h" 10 #include "app/menus/simple_menu_model.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // (e.g., because of a crash), we want to close the balloon. 293 // (e.g., because of a crash), we want to close the balloon.
294 notification_registrar_.Remove(this, 294 notification_registrar_.Remove(this,
295 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); 295 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_));
296 Close(false); 296 Close(false);
297 } 297 }
298 298
299 //////////////////////////////////////////////////////////////////////////////// 299 ////////////////////////////////////////////////////////////////////////////////
300 // BalloonViewImpl public. 300 // BalloonViewImpl public.
301 301
302 bool BalloonViewImpl::IsFor(const Notification& notification) const { 302 bool BalloonViewImpl::IsFor(const Notification& notification) const {
303 return balloon_->notification().IsSame(notification); 303 return balloon_->notification().notification_id() == notification.notification _id();
tfarina 2010/11/11 12:56:58 nit: line > 80 characters
John Gregg 2010/11/11 18:13:51 Done.
304 } 304 }
305 305
306 void BalloonViewImpl::Activated() { 306 void BalloonViewImpl::Activated() {
307 if (!control_view_host_.get()) 307 if (!control_view_host_.get())
308 return; 308 return;
309 309
310 // Get the size of Control View. 310 // Get the size of Control View.
311 gfx::Size size = 311 gfx::Size size =
312 control_view_host_->GetRootView()->GetChildViewAt(0)->GetPreferredSize(); 312 control_view_host_->GetRootView()->GetChildViewAt(0)->GetPreferredSize();
313 control_view_host_->Show(); 313 control_view_host_->Show();
(...skipping 24 matching lines...) Expand all
338 service->DenyPermission(balloon_->notification().origin_url()); 338 service->DenyPermission(balloon_->notification().origin_url());
339 } 339 }
340 340
341 gfx::NativeView BalloonViewImpl::GetParentNativeView() { 341 gfx::NativeView BalloonViewImpl::GetParentNativeView() {
342 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); 342 RenderWidgetHostView* view = html_contents_->render_view_host()->view();
343 DCHECK(view); 343 DCHECK(view);
344 return view->GetNativeView(); 344 return view->GetNativeView();
345 } 345 }
346 346
347 } // namespace chromeos 347 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698