| 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 "chrome/browser/notifications/balloon.h" | 5 #include "chrome/browser/notifications/balloon.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/notifications/balloon_collection.h" | 9 #include "chrome/browser/notifications/balloon_collection.h" |
| 10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 14 | 14 |
| 15 #if !defined(OS_WIN) && !defined(USE_AURA) | 15 #if !defined(USE_AURA) |
| 16 // static | 16 // static |
| 17 int BalloonView::GetHorizontalMargin() { | 17 int BalloonView::GetHorizontalMargin() { |
| 18 // TODO: implement for linux (non-aura) and mac. | 18 // TODO: implement for linux (non-aura) and mac. |
| 19 return 0; | 19 return 0; |
| 20 } | 20 } |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 Balloon::Balloon(const Notification& notification, Profile* profile, | 23 Balloon::Balloon(const Notification& notification, Profile* profile, |
| 24 BalloonCollection* collection) | 24 BalloonCollection* collection) |
| 25 : profile_(profile), | 25 : profile_(profile), |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 balloon_view_->Close(false); | 81 balloon_view_->Close(false); |
| 82 } | 82 } |
| 83 | 83 |
| 84 std::string Balloon::GetExtensionId() { | 84 std::string Balloon::GetExtensionId() { |
| 85 const ExtensionService* service = profile()->GetExtensionService(); | 85 const ExtensionService* service = profile()->GetExtensionService(); |
| 86 const extensions::Extension* extension = | 86 const extensions::Extension* extension = |
| 87 service->extensions()->GetExtensionOrAppByURL( | 87 service->extensions()->GetExtensionOrAppByURL( |
| 88 notification().origin_url()); | 88 notification().origin_url()); |
| 89 return extension ? extension->id() : std::string(); | 89 return extension ? extension->id() : std::string(); |
| 90 } | 90 } |
| OLD | NEW |