| 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 "extensions/renderer/app_window_custom_bindings.h" | 5 #include "extensions/renderer/app_window_custom_bindings.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "content/public/child/v8_value_converter.h" | 10 #include "content/public/child/v8_value_converter.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // these argument checks into CHECK(). | 68 // these argument checks into CHECK(). |
| 69 if (args.Length() != 2) | 69 if (args.Length() != 2) |
| 70 return; | 70 return; |
| 71 | 71 |
| 72 if (!args[0]->IsInt32()) | 72 if (!args[0]->IsInt32()) |
| 73 return; | 73 return; |
| 74 | 74 |
| 75 if (!args[1]->IsBoolean()) | 75 if (!args[1]->IsBoolean()) |
| 76 return; | 76 return; |
| 77 | 77 |
| 78 int view_id = args[0]->Int32Value(); | 78 int view_id = args[0].As<v8::Int32>()->Value(); |
| 79 | 79 |
| 80 bool inject_titlebar = args[1]->BooleanValue(); | 80 bool inject_titlebar = args[1].As<v8::Boolean>()->Value(); |
| 81 | 81 |
| 82 if (view_id == MSG_ROUTING_NONE) | 82 if (view_id == MSG_ROUTING_NONE) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 content::RenderView* view = content::RenderView::FromRoutingID(view_id); | 85 content::RenderView* view = content::RenderView::FromRoutingID(view_id); |
| 86 if (!view) | 86 if (!view) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 if (inject_titlebar) | 89 if (inject_titlebar) |
| 90 new DidCreateDocumentElementObserver(view, dispatcher_); | 90 new DidCreateDocumentElementObserver(view, dispatcher_); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 118 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) | 118 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) |
| 119 .as_string()); | 119 .as_string()); |
| 120 scoped_ptr<content::V8ValueConverter> converter( | 120 scoped_ptr<content::V8ValueConverter> converter( |
| 121 content::V8ValueConverter::create()); | 121 content::V8ValueConverter::create()); |
| 122 result = converter->ToV8Value(&value, context()->v8_context()); | 122 result = converter->ToV8Value(&value, context()->v8_context()); |
| 123 } | 123 } |
| 124 args.GetReturnValue().Set(result); | 124 args.GetReturnValue().Set(result); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace extensions | 127 } // namespace extensions |
| OLD | NEW |