Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: chrome/browser/ui/cocoa/web_intent_bubble_controller.mm

Issue 9307086: [Web Intents, Mac] Allow re-open after cancellation/close of picker bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed review issues Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 NSHeight([[self window] frame]); 296 NSHeight([[self window] frame]);
300 297
301 [[self window] setFrame:windowFrame display:YES animate:YES]; 298 [[self window] setFrame:windowFrame display:YES animate:YES];
302 299
303 // Replace the window's content. 300 // Replace the window's content.
304 [[[self window] contentView] setSubviews: 301 [[[self window] contentView] setSubviews:
305 [NSArray arrayWithObject:contentView]]; 302 [NSArray arrayWithObject:contentView]];
306 } 303 }
307 304
308 @end // WebIntentBubbleController 305 @end // WebIntentBubbleController
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698