| 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/web_intent_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/web_intent_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
| 10 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" | 10 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 GURL url(l10n_util::GetStringUTF8(IDS_WEBSTORE_URL)); | 117 GURL url(l10n_util::GetStringUTF8(IDS_WEBSTORE_URL)); |
| 118 Browser* browser = BrowserList::GetLastActive(); | 118 Browser* browser = BrowserList::GetLastActive(); |
| 119 OpenURLParams params( | 119 OpenURLParams params( |
| 120 url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, | 120 url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, |
| 121 false); | 121 false); |
| 122 browser->OpenURL(params); | 122 browser->OpenURL(params); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // A picker button has been pressed - invoke corresponding service. | 125 // A picker button has been pressed - invoke corresponding service. |
| 126 - (IBAction)invokeService:(id)sender { | 126 - (IBAction)invokeService:(id)sender { |
| 127 if (picker_) { | 127 if (picker_) |
| 128 WebIntentPickerCocoa* temp = picker_; | 128 picker_->OnServiceChosen([sender tag]); |
| 129 picker_ = NULL; // Abandon picker, we are done with it. | |
| 130 temp->OnServiceChosen([sender tag]); | |
| 131 } | |
| 132 } | 129 } |
| 133 | 130 |
| 134 // Sets proprties on the given |field| to act as the title or description labels | 131 // Sets proprties on the given |field| to act as the title or description labels |
| 135 // in the bubble. | 132 // in the bubble. |
| 136 - (void)configureTextFieldAsLabel:(NSTextField*)field { | 133 - (void)configureTextFieldAsLabel:(NSTextField*)field { |
| 137 [field setEditable:NO]; | 134 [field setEditable:NO]; |
| 138 [field setSelectable:YES]; | 135 [field setSelectable:YES]; |
| 139 [field setDrawsBackground:NO]; | 136 [field setDrawsBackground:NO]; |
| 140 [field setBezeled:NO]; | 137 [field setBezeled:NO]; |
| 141 } | 138 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 NSHeight([[self window] frame]); | 295 NSHeight([[self window] frame]); |
| 299 | 296 |
| 300 [[self window] setFrame:windowFrame display:YES animate:YES]; | 297 [[self window] setFrame:windowFrame display:YES animate:YES]; |
| 301 | 298 |
| 302 // Replace the window's content. | 299 // Replace the window's content. |
| 303 [[[self window] contentView] setSubviews: | 300 [[[self window] contentView] setSubviews: |
| 304 [NSArray arrayWithObject:contentView]]; | 301 [NSArray arrayWithObject:contentView]]; |
| 305 } | 302 } |
| 306 | 303 |
| 307 @end // WebIntentBubbleController | 304 @end // WebIntentBubbleController |
| OLD | NEW |