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

Unified Diff: chrome/browser/notifications/balloon.cc

Issue 338051: Adds UI components for desktop notifications, including balloon view classes ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: use notused.png resources for try servers Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/notifications/balloon.h ('k') | chrome/browser/notifications/balloon_collection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/balloon.cc
===================================================================
--- chrome/browser/notifications/balloon.cc (revision 0)
+++ chrome/browser/notifications/balloon.cc (revision 0)
@@ -0,0 +1,43 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/notifications/balloon.h"
+
+#include "base/gfx/rect.h"
+#include "base/logging.h"
+#include "chrome/browser/notifications/balloon_collection.h"
+#include "chrome/browser/renderer_host/site_instance.h"
+
+Balloon::Balloon(const Notification& notification, Profile* profile,
+ BalloonCloseListener* listener)
+ : profile_(profile),
+ notification_(notification),
+ close_listener_(listener) {
+}
+
+Balloon::~Balloon() {
+}
+
+void Balloon::SetPosition(const gfx::Point& upper_left, bool reposition) {
+ position_ = upper_left;
+ if (reposition && balloon_view_.get())
+ balloon_view_->RepositionToBalloon();
+}
+
+void Balloon::set_view(BalloonView* balloon_view) {
+ balloon_view_.reset(balloon_view);
+}
+
+void Balloon::Show() {
+ notification_.Display();
+ if (balloon_view_.get()) {
+ balloon_view_->Show(this);
+ }
+}
+
+void Balloon::Close(bool by_user) {
+ notification_.Close(by_user);
+ if (close_listener_)
+ close_listener_->OnBalloonClosed(this);
+}
Property changes on: chrome\browser\notifications\balloon.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/notifications/balloon.h ('k') | chrome/browser/notifications/balloon_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698