| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/debugger/debugger_node.h" | 5 #include "chrome/browser/debugger/debugger_node.h" |
| 6 | 6 |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return NULL; | 194 return NULL; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 v8::Handle<v8::Value> BrowserNode::PropGetter(v8::Handle<v8::String> prop, | 198 v8::Handle<v8::Value> BrowserNode::PropGetter(v8::Handle<v8::String> prop, |
| 199 const v8::AccessorInfo& info) { | 199 const v8::AccessorInfo& info) { |
| 200 Browser *b = GetBrowser(); | 200 Browser *b = GetBrowser(); |
| 201 if (b != NULL) { | 201 if (b != NULL) { |
| 202 if (prop->Equals(v8::String::New("title"))) { | 202 if (prop->Equals(v8::String::New("title"))) { |
| 203 const TabContents *t = b->GetSelectedTabContents(); | 203 const TabContents *t = b->GetSelectedTabContents(); |
| 204 std::wstring title = t->GetTitle(); | 204 std::wstring title = UTF16ToWideHack(t->GetTitle()); |
| 205 std::string title2 = WideToUTF8(title); | 205 std::string title2 = WideToUTF8(title); |
| 206 return v8::String::New(title2.c_str()); | 206 return v8::String::New(title2.c_str()); |
| 207 } else if (prop->Equals(v8::String::New("tab"))) { | 207 } else if (prop->Equals(v8::String::New("tab"))) { |
| 208 TabListNode* node = TabListNode::TabList(b); | 208 TabListNode* node = TabListNode::TabList(b); |
| 209 return node->NewInstance(); | 209 return node->NewInstance(); |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 return v8::Undefined(); | 212 return v8::Undefined(); |
| 213 } | 213 } |
| 214 | 214 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 host->DebugBreak(force); | 352 host->DebugBreak(force); |
| 353 return v8::Undefined(); | 353 return v8::Undefined(); |
| 354 } | 354 } |
| 355 | 355 |
| 356 v8::Handle<v8::Value> TabNode::PropGetter(v8::Handle<v8::String> prop, | 356 v8::Handle<v8::Value> TabNode::PropGetter(v8::Handle<v8::String> prop, |
| 357 const v8::AccessorInfo& info) { | 357 const v8::AccessorInfo& info) { |
| 358 TabContents* t = GetTab(); | 358 TabContents* t = GetTab(); |
| 359 if (t != NULL) { | 359 if (t != NULL) { |
| 360 WebContents* web = t->AsWebContents(); | 360 WebContents* web = t->AsWebContents(); |
| 361 if (prop->Equals(v8::String::New("title"))) { | 361 if (prop->Equals(v8::String::New("title"))) { |
| 362 std::wstring title = t->GetTitle(); | 362 std::wstring title = UTF16ToWideHack(t->GetTitle()); |
| 363 std::string title2 = WideToUTF8(title); | 363 std::string title2 = WideToUTF8(title); |
| 364 return v8::String::New(title2.c_str()); | 364 return v8::String::New(title2.c_str()); |
| 365 } else if (web) { | 365 } else if (web) { |
| 366 if (prop->Equals(v8::String::New("attach"))) { | 366 if (prop->Equals(v8::String::New("attach"))) { |
| 367 FunctionNode<WebContents>* f = | 367 FunctionNode<WebContents>* f = |
| 368 new FunctionNode<WebContents>(TabNode::Attach, web); | 368 new FunctionNode<WebContents>(TabNode::Attach, web); |
| 369 return f->NewInstance(); | 369 return f->NewInstance(); |
| 370 } else if (prop->Equals(v8::String::New("detach"))) { | 370 } else if (prop->Equals(v8::String::New("detach"))) { |
| 371 FunctionNode<WebContents>* f = | 371 FunctionNode<WebContents>* f = |
| 372 new FunctionNode<WebContents>(TabNode::Detach, web); | 372 new FunctionNode<WebContents>(TabNode::Detach, web); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 | 388 |
| 389 ////////////////////////////////// | 389 ////////////////////////////////// |
| 390 | 390 |
| 391 template<class T> | 391 template<class T> |
| 392 v8::Handle<v8::Value> FunctionNode<T>::Function(const v8::Arguments &args) { | 392 v8::Handle<v8::Value> FunctionNode<T>::Function(const v8::Arguments &args) { |
| 393 return function_(args, data_); | 393 return function_(args, data_); |
| 394 } | 394 } |
| 395 | 395 |
| OLD | NEW |