OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/script_context.h" | 5 #include "extensions/renderer/script_context.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 case Feature::CONTENT_SCRIPT_CONTEXT: | 50 case Feature::CONTENT_SCRIPT_CONTEXT: |
51 return "CONTENT_SCRIPT"; | 51 return "CONTENT_SCRIPT"; |
52 case Feature::WEB_PAGE_CONTEXT: | 52 case Feature::WEB_PAGE_CONTEXT: |
53 return "WEB_PAGE"; | 53 return "WEB_PAGE"; |
54 case Feature::BLESSED_WEB_PAGE_CONTEXT: | 54 case Feature::BLESSED_WEB_PAGE_CONTEXT: |
55 return "BLESSED_WEB_PAGE"; | 55 return "BLESSED_WEB_PAGE"; |
56 case Feature::WEBUI_CONTEXT: | 56 case Feature::WEBUI_CONTEXT: |
57 return "WEBUI"; | 57 return "WEBUI"; |
58 case Feature::SERVICE_WORKER_CONTEXT: | 58 case Feature::SERVICE_WORKER_CONTEXT: |
59 return "SERVICE_WORKER"; | 59 return "SERVICE_WORKER"; |
| 60 case Feature::LOCK_SCREEN_EXTENSION_CONTEXT: |
| 61 return "LOCK_SCREEN_EXTENSION"; |
60 } | 62 } |
61 NOTREACHED(); | 63 NOTREACHED(); |
62 return std::string(); | 64 return std::string(); |
63 } | 65 } |
64 | 66 |
65 static std::string ToStringOrDefault( | 67 static std::string ToStringOrDefault( |
66 const v8::Local<v8::String>& v8_string, | 68 const v8::Local<v8::String>& v8_string, |
67 const std::string& dflt) { | 69 const std::string& dflt) { |
68 if (v8_string.IsEmpty()) | 70 if (v8_string.IsEmpty()) |
69 return dflt; | 71 return dflt; |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 v8::Local<v8::Value> argv[]) { | 529 v8::Local<v8::Value> argv[]) { |
528 return context_->CallFunction(function, argc, argv); | 530 return context_->CallFunction(function, argc, argv); |
529 } | 531 } |
530 | 532 |
531 gin::ContextHolder* ScriptContext::Runner::GetContextHolder() { | 533 gin::ContextHolder* ScriptContext::Runner::GetContextHolder() { |
532 v8::HandleScope handle_scope(context_->isolate()); | 534 v8::HandleScope handle_scope(context_->isolate()); |
533 return gin::PerContextData::From(context_->v8_context())->context_holder(); | 535 return gin::PerContextData::From(context_->v8_context())->context_holder(); |
534 } | 536 } |
535 | 537 |
536 } // namespace extensions | 538 } // namespace extensions |
OLD | NEW |