| 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/intents/web_intent_inline_service_view_controll
er.h" | 5 #import "chrome/browser/ui/cocoa/intents/web_intent_inline_service_view_controll
er.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser_finder.h" | 7 #include "chrome/browser/ui/browser_finder.h" |
| 8 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_u
tils.h" | 8 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_u
tils.h" |
| 9 #import "chrome/browser/ui/cocoa/flipped_view.h" | 9 #import "chrome/browser/ui/cocoa/flipped_view.h" |
| 10 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" | 10 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" |
| 11 #import "chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h" | 11 #import "chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h" |
| 12 #include "chrome/browser/ui/constrained_window.h" | 12 #include "chrome/browser/ui/constrained_window.h" |
| 13 #include "chrome/browser/ui/constrained_window_constants.h" |
| 13 #include "chrome/browser/ui/intents/web_intent_picker.h" | 14 #include "chrome/browser/ui/intents/web_intent_picker.h" |
| 14 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" | 15 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" |
| 15 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" | 16 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 18 #include "skia/ext/skia_utils_mac.h" | 19 #include "skia/ext/skia_utils_mac.h" |
| 19 #include "ui/base/l10n/l10n_util_mac.h" | 20 #include "ui/base/l10n/l10n_util_mac.h" |
| 20 | 21 |
| 21 @implementation WebIntentInlineServiceViewController | 22 @implementation WebIntentInlineServiceViewController |
| 22 | 23 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 CGFloat height = NSHeight([serviceNameTextField_ frame]); | 70 CGFloat height = NSHeight([serviceNameTextField_ frame]); |
| 70 height += WebIntentPicker::kHeaderSeparatorPaddingTop + | 71 height += WebIntentPicker::kHeaderSeparatorPaddingTop + |
| 71 WebIntentPicker::kHeaderSeparatorPaddingBottom; | 72 WebIntentPicker::kHeaderSeparatorPaddingBottom; |
| 72 return NSMakeSize(NSWidth(frame), NSHeight(frame) - height); | 73 return NSMakeSize(NSWidth(frame), NSHeight(frame) - height); |
| 73 } | 74 } |
| 74 | 75 |
| 75 - (void)setServiceName:(NSString*)serviceName { | 76 - (void)setServiceName:(NSString*)serviceName { |
| 76 [serviceNameTextField_ setAttributedStringValue: | 77 [serviceNameTextField_ setAttributedStringValue: |
| 77 constrained_window::GetAttributedLabelString( | 78 constrained_window::GetAttributedLabelString( |
| 78 serviceName, | 79 serviceName, |
| 79 ConstrainedWindow::kBoldTextFontStyle, | 80 ConstrainedWindowConstants::kBoldTextFontStyle, |
| 80 NSLeftTextAlignment, | 81 NSLeftTextAlignment, |
| 81 NSLineBreakByTruncatingTail)]; | 82 NSLineBreakByTruncatingTail)]; |
| 82 [serviceNameTextField_ sizeToFit]; | 83 [serviceNameTextField_ sizeToFit]; |
| 83 } | 84 } |
| 84 | 85 |
| 85 - (void)setServiceIcon:(NSImage*)serviceIcon { | 86 - (void)setServiceIcon:(NSImage*)serviceIcon { |
| 86 [serviceIconImageView_ setImage:serviceIcon]; | 87 [serviceIconImageView_ setImage:serviceIcon]; |
| 87 } | 88 } |
| 88 | 89 |
| 89 - (void)setServiceURL:(const GURL&)url { | 90 - (void)setServiceURL:(const GURL&)url { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 WebIntentPicker::kHeaderSeparatorPaddingBottom; | 164 WebIntentPicker::kHeaderSeparatorPaddingBottom; |
| 164 webFrame.origin.x = NSMinX(innerFrame); | 165 webFrame.origin.x = NSMinX(innerFrame); |
| 165 webFrame.size.width = NSWidth(innerFrame); | 166 webFrame.size.width = NSWidth(innerFrame); |
| 166 webFrame.size.height = NSMaxY(innerFrame) - NSMinY(webFrame); | 167 webFrame.size.height = NSMaxY(innerFrame) - NSMinY(webFrame); |
| 167 [webContentView_ setFrame:webFrame]; | 168 [webContentView_ setFrame:webFrame]; |
| 168 [webContents_->GetNativeView() setFrame:[webContentView_ bounds]]; | 169 [webContents_->GetNativeView() setFrame:[webContentView_ bounds]]; |
| 169 } | 170 } |
| 170 } | 171 } |
| 171 | 172 |
| 172 @end | 173 @end |
| OLD | NEW |