OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #import "base/memory/scoped_nsobject.h" | 9 #import "base/memory/scoped_nsobject.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 CURRENT_TAB, | 118 CURRENT_TAB, |
119 PageTransition::TYPED); | 119 PageTransition::TYPED); |
120 } | 120 } |
121 | 121 |
122 - (NSString*)title { | 122 - (NSString*)title { |
123 NavigationEntry* entry = tabContents_->controller().GetActiveEntry(); | 123 NavigationEntry* entry = tabContents_->controller().GetActiveEntry(); |
124 if (!entry) | 124 if (!entry) |
125 return nil; | 125 return nil; |
126 | 126 |
127 std::wstring title; | 127 std::wstring title; |
128 // TODO(evan): use directionality of title. | 128 if (entry != NULL) { |
129 // http://code.google.com/p/chromium/issues/detail?id=27094 | 129 title = UTF16ToWideHack(entry->title()); |
130 if (entry != NULL) | 130 } |
131 title = UTF16ToWideHack(entry->title().string()); | |
132 | 131 |
133 return base::SysWideToNSString(title); | 132 return base::SysWideToNSString(title); |
134 } | 133 } |
135 | 134 |
136 - (NSNumber*)loading { | 135 - (NSNumber*)loading { |
137 BOOL loadingValue = tabContents_->tab_contents()->is_loading() ? YES : NO; | 136 BOOL loadingValue = tabContents_->tab_contents()->is_loading() ? YES : NO; |
138 return [NSNumber numberWithBool:loadingValue]; | 137 return [NSNumber numberWithBool:loadingValue]; |
139 } | 138 } |
140 | 139 |
141 - (void)handlesUndoScriptCommand:(NSScriptCommand*)command { | 140 - (void)handlesUndoScriptCommand:(NSScriptCommand*)command { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 294 |
296 string16 script = base::SysNSStringToUTF16( | 295 string16 script = base::SysNSStringToUTF16( |
297 [[command evaluatedArguments] objectForKey:@"javascript"]); | 296 [[command evaluatedArguments] objectForKey:@"javascript"]); |
298 view->ExecuteJavascriptInWebFrame(string16(), script); | 297 view->ExecuteJavascriptInWebFrame(string16(), script); |
299 | 298 |
300 // TODO(Shreyas): Figure out a way to get the response back. | 299 // TODO(Shreyas): Figure out a way to get the response back. |
301 return nil; | 300 return nil; |
302 } | 301 } |
303 | 302 |
304 @end | 303 @end |
OLD | NEW |