| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return dflt; | 282 return dflt; |
| 283 std::string ascii_value = *v8::String::AsciiValue(v8_string); | 283 std::string ascii_value = *v8::String::AsciiValue(v8_string); |
| 284 return ascii_value.empty() ? dflt : ascii_value; | 284 return ascii_value.empty() ? dflt : ascii_value; |
| 285 } | 285 } |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 void InstallAppBindings(ModuleSystem* module_system, | 288 void InstallAppBindings(ModuleSystem* module_system, |
| 289 v8::Handle<v8::Object> chrome, | 289 v8::Handle<v8::Object> chrome, |
| 290 v8::Handle<v8::Object> chrome_hidden) { | 290 v8::Handle<v8::Object> chrome_hidden) { |
| 291 module_system->SetLazyField(chrome, "app", "app", "chromeApp"); | 291 module_system->SetLazyField(chrome, "app", "app", "chromeApp"); |
| 292 module_system->SetLazyField(chrome, "appNotifications", "app", | |
| 293 "chromeAppNotifications"); | |
| 294 module_system->SetLazyField(chrome_hidden, "app", "app", | 292 module_system->SetLazyField(chrome_hidden, "app", "app", |
| 295 "chromeHiddenApp"); | 293 "chromeHiddenApp"); |
| 296 } | 294 } |
| 297 | 295 |
| 298 void InstallWebstoreBindings(ModuleSystem* module_system, | 296 void InstallWebstoreBindings(ModuleSystem* module_system, |
| 299 v8::Handle<v8::Object> chrome, | 297 v8::Handle<v8::Object> chrome, |
| 300 v8::Handle<v8::Object> chrome_hidden) { | 298 v8::Handle<v8::Object> chrome_hidden) { |
| 301 module_system->SetLazyField(chrome, "webstore", "webstore", "chromeWebstore"); | 299 module_system->SetLazyField(chrome, "webstore", "webstore", "chromeWebstore"); |
| 302 module_system->SetLazyField(chrome_hidden, "webstore", "webstore", | 300 module_system->SetLazyField(chrome_hidden, "webstore", "webstore", |
| 303 "chromeHiddenWebstore"); | 301 "chromeHiddenWebstore"); |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1161 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
| 1164 v8::ThrowException( | 1162 v8::ThrowException( |
| 1165 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1163 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
| 1166 return false; | 1164 return false; |
| 1167 } | 1165 } |
| 1168 | 1166 |
| 1169 return true; | 1167 return true; |
| 1170 } | 1168 } |
| 1171 | 1169 |
| 1172 } // namespace extensions | 1170 } // namespace extensions |
| OLD | NEW |