| OLD | NEW | 
|    1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2011 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/ui/cocoa/notifications/balloon_controller.h" |    5 #include "chrome/browser/ui/cocoa/notifications/balloon_controller.h" | 
|    6  |    6  | 
|    7 #include "app/mac/nsimage_cache.h" |    7 #include "app/mac/nsimage_cache.h" | 
|    8 #import "base/mac/cocoa_protocols.h" |    8 #import "base/mac/cocoa_protocols.h" | 
|    9 #include "base/mac/mac_util.h" |    9 #include "base/mac/mac_util.h" | 
|   10 #import "base/memory/scoped_nsobject.h" |   10 #import "base/memory/scoped_nsobject.h" | 
|   11 #include "base/utf_string_conversions.h" |   11 #include "base/utf_string_conversions.h" | 
|   12 #include "chrome/browser/notifications/balloon.h" |   12 #include "chrome/browser/notifications/balloon.h" | 
|   13 #include "chrome/browser/notifications/desktop_notification_service.h" |   13 #include "chrome/browser/notifications/desktop_notification_service.h" | 
|   14 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |  | 
|   15 #include "chrome/browser/notifications/notification.h" |   14 #include "chrome/browser/notifications/notification.h" | 
|   16 #include "chrome/browser/notifications/notification_options_menu_model.h" |   15 #include "chrome/browser/notifications/notification_options_menu_model.h" | 
|   17 #include "chrome/browser/profiles/profile.h" |   16 #include "chrome/browser/profiles/profile.h" | 
|   18 #import "chrome/browser/ui/cocoa/hover_image_button.h" |   17 #import "chrome/browser/ui/cocoa/hover_image_button.h" | 
|   19 #import "chrome/browser/ui/cocoa/menu_controller.h" |   18 #import "chrome/browser/ui/cocoa/menu_controller.h" | 
|   20 #import "chrome/browser/ui/cocoa/notifications/balloon_view.h" |   19 #import "chrome/browser/ui/cocoa/notifications/balloon_view.h" | 
|   21 #include "chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h" |   20 #include "chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h" | 
|   22 #include "content/browser/renderer_host/render_view_host.h" |   21 #include "content/browser/renderer_host/render_view_host.h" | 
|   23 #include "grit/generated_resources.h" |   22 #include "grit/generated_resources.h" | 
|   24 #include "grit/theme_resources.h" |   23 #include "grit/theme_resources.h" | 
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  138   [NSMenu popUpContextMenu:[menuController_ menu] |  137   [NSMenu popUpContextMenu:[menuController_ menu] | 
|  139                  withEvent:[NSApp currentEvent] |  138                  withEvent:[NSApp currentEvent] | 
|  140                    forView:optionsButton_]; |  139                    forView:optionsButton_]; | 
|  141   optionMenuIsActive_ = NO; |  140   optionMenuIsActive_ = NO; | 
|  142   if (delayedClose_) |  141   if (delayedClose_) | 
|  143     [self closeBalloonNow: false]; // always by script. |  142     [self closeBalloonNow: false]; // always by script. | 
|  144 } |  143 } | 
|  145  |  144  | 
|  146 - (IBAction)permissionRevoked:(id)sender { |  145 - (IBAction)permissionRevoked:(id)sender { | 
|  147   DesktopNotificationService* service = |  146   DesktopNotificationService* service = | 
|  148       DesktopNotificationServiceFactory::GetForProfile(balloon_->profile()); |  147       balloon_->profile()->GetDesktopNotificationService(); | 
|  149   service->DenyPermission(balloon_->notification().origin_url()); |  148   service->DenyPermission(balloon_->notification().origin_url()); | 
|  150 } |  149 } | 
|  151  |  150  | 
|  152 - (IBAction)closeButtonPressed:(id)sender { |  151 - (IBAction)closeButtonPressed:(id)sender { | 
|  153   [self closeBalloon:YES]; |  152   [self closeBalloon:YES]; | 
|  154   [self close]; |  153   [self close]; | 
|  155 } |  154 } | 
|  156  |  155  | 
|  157 - (void)close { |  156 - (void)close { | 
|  158   if (closeButtonTrackingTag_) |  157   if (closeButtonTrackingTag_) | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  215   htmlContents_.reset(new BalloonViewHost(balloon_)); |  214   htmlContents_.reset(new BalloonViewHost(balloon_)); | 
|  216   htmlContents_->Init(); |  215   htmlContents_->Init(); | 
|  217 } |  216 } | 
|  218  |  217  | 
|  219 // NSWindowDelegate notification. |  218 // NSWindowDelegate notification. | 
|  220 - (void)windowWillClose:(NSNotification*)notif { |  219 - (void)windowWillClose:(NSNotification*)notif { | 
|  221   [self autorelease]; |  220   [self autorelease]; | 
|  222 } |  221 } | 
|  223  |  222  | 
|  224 @end |  223 @end | 
| OLD | NEW |