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

Side by Side Diff: chrome/browser/ui/cocoa/applescript/tab_applescript.mm

Issue 10911351: Switch PrintViewManager, PrintPreviewMessageHandler to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix typo Created 8 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/applescript/tab_applescript.h" 5 #import "chrome/browser/ui/cocoa/applescript/tab_applescript.h"
6 6
7 #import <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 #import <Foundation/NSAppleEventDescriptor.h> 8 #import <Foundation/NSAppleEventDescriptor.h>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // We tolerate Stop being called even before a view has been created. 335 // We tolerate Stop being called even before a view has been created.
336 // So just log a warning instead of a NOTREACHED(). 336 // So just log a warning instead of a NOTREACHED().
337 DLOG(WARNING) << "Stop: no view for handle "; 337 DLOG(WARNING) << "Stop: no view for handle ";
338 return; 338 return;
339 } 339 }
340 340
341 view->Stop(); 341 view->Stop();
342 } 342 }
343 343
344 - (void)handlesPrintScriptCommand:(NSScriptCommand*)command { 344 - (void)handlesPrintScriptCommand:(NSScriptCommand*)command {
345 bool initiateStatus = tabContents_->print_view_manager()->PrintNow(); 345 bool initiateStatus = printing::PrintViewManager::FromWebContents(
346 tabContents_->web_contents())->PrintNow();
346 if (initiateStatus == false) { 347 if (initiateStatus == false) {
347 AppleScript::SetError(AppleScript::errInitiatePrinting); 348 AppleScript::SetError(AppleScript::errInitiatePrinting);
348 } 349 }
349 } 350 }
350 351
351 - (void)handlesSaveScriptCommand:(NSScriptCommand*)command { 352 - (void)handlesSaveScriptCommand:(NSScriptCommand*)command {
352 NSDictionary* dictionary = [command evaluatedArguments]; 353 NSDictionary* dictionary = [command evaluatedArguments];
353 354
354 NSURL* fileURL = [dictionary objectForKey:@"File"]; 355 NSURL* fileURL = [dictionary objectForKey:@"File"];
355 // Scripter has not specifed the location at which to save, so we prompt for 356 // Scripter has not specifed the location at which to save, so we prompt for
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 411 }
411 412
412 string16 script = base::SysNSStringToUTF16( 413 string16 script = base::SysNSStringToUTF16(
413 [[command evaluatedArguments] objectForKey:@"javascript"]); 414 [[command evaluatedArguments] objectForKey:@"javascript"]);
414 Value* value = view->ExecuteJavascriptAndGetValue(string16(), script); 415 Value* value = view->ExecuteJavascriptAndGetValue(string16(), script);
415 NSAppleEventDescriptor* descriptor = valueToDescriptor(value); 416 NSAppleEventDescriptor* descriptor = valueToDescriptor(value);
416 return [[[AnyResultValue alloc] initWithDescriptor:descriptor] autorelease]; 417 return [[[AnyResultValue alloc] initWithDescriptor:descriptor] autorelease];
417 } 418 }
418 419
419 @end 420 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698