OLD | NEW |
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/cocoa/page_info_window_mac.h" | 5 #include "chrome/browser/cocoa/page_info_window_mac.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/scoped_cftyperef.h" | 10 #include "base/scoped_cftyperef.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 [text_field setFrame:text_field_rect]; | 214 [text_field setFrame:text_field_rect]; |
215 | 215 |
216 // Insert the image subview. | 216 // Insert the image subview. |
217 NSRect image_view_rect = | 217 NSRect image_view_rect = |
218 NSMakeRect(kBoxHorizontalSpacing, | 218 NSMakeRect(kBoxHorizontalSpacing, |
219 box_height - (kImageSize + kBoxTopSpacing), | 219 box_height - (kImageSize + kBoxTopSpacing), |
220 kImageSize, kImageSize); | 220 kImageSize, kImageSize); |
221 scoped_nsobject<NSImageView> image_view( | 221 scoped_nsobject<NSImageView> image_view( |
222 [[NSImageView alloc] initWithFrame:image_view_rect]); | 222 [[NSImageView alloc] initWithFrame:image_view_rect]); |
223 [image_view setImageFrameStyle:NSImageFrameNone]; | 223 [image_view setImageFrameStyle:NSImageFrameNone]; |
224 [image_view setImage:(info.state != PageInfoModel::SECTION_STATE_ERROR) ? | 224 [image_view setImage:(info.state == PageInfoModel::SECTION_STATE_OK) ? |
225 good_image_.get() : bad_image_.get()]; | 225 good_image_.get() : bad_image_.get()]; |
226 | 226 |
227 // Add the box to the list of new subviews. | 227 // Add the box to the list of new subviews. |
228 [box addSubview:image_view.get()]; | 228 [box addSubview:image_view.get()]; |
229 [box addSubview:text_field.get()]; | 229 [box addSubview:text_field.get()]; |
230 [subviews addObject:box.get()]; | 230 [subviews addObject:box.get()]; |
231 } | 231 } |
232 | 232 |
233 // Replace the window's content. | 233 // Replace the window's content. |
234 [[[controller_ window] contentView] setSubviews:subviews]; | 234 [[[controller_ window] contentView] setSubviews:subviews]; |
(...skipping 16 matching lines...) Expand all Loading... |
251 [cert_button setEnabled:YES]; | 251 [cert_button setEnabled:YES]; |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 // Resize the window. Only animate if the window is visible, otherwise it | 255 // Resize the window. Only animate if the window is visible, otherwise it |
256 // could be "growing" while it's opening, looking awkward. | 256 // could be "growing" while it's opening, looking awkward. |
257 [[controller_ window] setFrame:window_frame | 257 [[controller_ window] setFrame:window_frame |
258 display:YES | 258 display:YES |
259 animate:[[controller_ window] isVisible]]; | 259 animate:[[controller_ window] isVisible]]; |
260 } | 260 } |
OLD | NEW |