| 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 #include "chrome/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 return dflt; | 361 return dflt; |
| 362 std::string ascii_value = *v8::String::AsciiValue(v8_string); | 362 std::string ascii_value = *v8::String::AsciiValue(v8_string); |
| 363 return ascii_value.empty() ? dflt : ascii_value; | 363 return ascii_value.empty() ? dflt : ascii_value; |
| 364 } | 364 } |
| 365 }; | 365 }; |
| 366 | 366 |
| 367 void InstallAppBindings(ModuleSystem* module_system, | 367 void InstallAppBindings(ModuleSystem* module_system, |
| 368 v8::Handle<v8::Object> chrome, | 368 v8::Handle<v8::Object> chrome, |
| 369 v8::Handle<v8::Object> chrome_hidden) { | 369 v8::Handle<v8::Object> chrome_hidden) { |
| 370 module_system->SetLazyField(chrome, "app", "app", "chromeApp"); | 370 module_system->SetLazyField(chrome, "app", "app", "chromeApp"); |
| 371 module_system->SetLazyField(chrome, "appNotifications", "app", | |
| 372 "chromeAppNotifications"); | |
| 373 module_system->SetLazyField(chrome_hidden, "app", "app", | 371 module_system->SetLazyField(chrome_hidden, "app", "app", |
| 374 "chromeHiddenApp"); | 372 "chromeHiddenApp"); |
| 375 } | 373 } |
| 376 | 374 |
| 377 void InstallWebstoreBindings(ModuleSystem* module_system, | 375 void InstallWebstoreBindings(ModuleSystem* module_system, |
| 378 v8::Handle<v8::Object> chrome, | 376 v8::Handle<v8::Object> chrome, |
| 379 v8::Handle<v8::Object> chrome_hidden) { | 377 v8::Handle<v8::Object> chrome_hidden) { |
| 380 module_system->SetLazyField(chrome, "webstore", "webstore", "chromeWebstore"); | 378 module_system->SetLazyField(chrome, "webstore", "webstore", "chromeWebstore"); |
| 381 module_system->SetLazyField(chrome_hidden, "webstore", "webstore", | 379 module_system->SetLazyField(chrome_hidden, "webstore", "webstore", |
| 382 "chromeHiddenWebstore"); | 380 "chromeHiddenWebstore"); |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1316 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
| 1319 v8::ThrowException( | 1317 v8::ThrowException( |
| 1320 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1318 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
| 1321 return false; | 1319 return false; |
| 1322 } | 1320 } |
| 1323 | 1321 |
| 1324 return true; | 1322 return true; |
| 1325 } | 1323 } |
| 1326 | 1324 |
| 1327 } // namespace extensions | 1325 } // namespace extensions |
| OLD | NEW |