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 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
9 #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" |
10 #import "chrome/browser/ui/confirm_bubble_model.h" | 10 #import "chrome/browser/ui/confirm_bubble_model.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 - (BOOL)hasOkButton { | 64 - (BOOL)hasOkButton { |
65 return (model_->GetButtons() & ConfirmBubbleModel::BUTTON_OK) ? YES : NO; | 65 return (model_->GetButtons() & ConfirmBubbleModel::BUTTON_OK) ? YES : NO; |
66 } | 66 } |
67 | 67 |
68 - (BOOL)hasCancelButton { | 68 - (BOOL)hasCancelButton { |
69 return (model_->GetButtons() & ConfirmBubbleModel::BUTTON_CANCEL) ? YES : NO; | 69 return (model_->GetButtons() & ConfirmBubbleModel::BUTTON_CANCEL) ? YES : NO; |
70 } | 70 } |
71 | 71 |
72 - (NSImage*)icon { | |
73 gfx::Image* image = model_->GetIcon(); | |
74 return !image ? nil : image->ToNSImage(); | |
75 } | |
76 | |
77 // Action handlers. | 72 // Action handlers. |
78 - (void)accept { | 73 - (void)accept { |
79 model_->Accept(); | 74 model_->Accept(); |
80 } | 75 } |
81 | 76 |
82 - (void)cancel { | 77 - (void)cancel { |
83 model_->Cancel(); | 78 model_->Cancel(); |
84 } | 79 } |
85 | 80 |
86 - (void)linkClicked { | 81 - (void)linkClicked { |
87 model_->LinkClicked(); | 82 model_->LinkClicked(); |
88 } | 83 } |
89 | 84 |
90 @end | 85 @end |
OLD | NEW |