| 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/runtime_custom_bindings.h" | 5 #include "chrome/renderer/extensions/runtime_custom_bindings.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/renderer/extensions/api_activity_logger.h" | 10 #include "chrome/renderer/extensions/api_activity_logger.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 std::string view_type_string = *v8::String::Utf8Value(args[1]->ToString()); | 137 std::string view_type_string = *v8::String::Utf8Value(args[1]->ToString()); |
| 138 StringToUpperASCII(&view_type_string); | 138 StringToUpperASCII(&view_type_string); |
| 139 // |view_type| == VIEW_TYPE_INVALID means getting any type of | 139 // |view_type| == VIEW_TYPE_INVALID means getting any type of |
| 140 // views. | 140 // views. |
| 141 ViewType view_type = VIEW_TYPE_INVALID; | 141 ViewType view_type = VIEW_TYPE_INVALID; |
| 142 if (view_type_string == kViewTypeBackgroundPage) { | 142 if (view_type_string == kViewTypeBackgroundPage) { |
| 143 view_type = VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; | 143 view_type = VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; |
| 144 } else if (view_type_string == kViewTypeInfobar) { | 144 } else if (view_type_string == kViewTypeInfobar) { |
| 145 view_type = VIEW_TYPE_EXTENSION_INFOBAR; | 145 view_type = VIEW_TYPE_EXTENSION_INFOBAR; |
| 146 } else if (view_type_string == kViewTypeNotification) { | |
| 147 view_type = VIEW_TYPE_NOTIFICATION; | |
| 148 } else if (view_type_string == kViewTypeTabContents) { | 146 } else if (view_type_string == kViewTypeTabContents) { |
| 149 view_type = VIEW_TYPE_TAB_CONTENTS; | 147 view_type = VIEW_TYPE_TAB_CONTENTS; |
| 150 } else if (view_type_string == kViewTypePopup) { | 148 } else if (view_type_string == kViewTypePopup) { |
| 151 view_type = VIEW_TYPE_EXTENSION_POPUP; | 149 view_type = VIEW_TYPE_EXTENSION_POPUP; |
| 152 } else if (view_type_string == kViewTypeExtensionDialog) { | 150 } else if (view_type_string == kViewTypeExtensionDialog) { |
| 153 view_type = VIEW_TYPE_EXTENSION_DIALOG; | 151 view_type = VIEW_TYPE_EXTENSION_DIALOG; |
| 154 } else if (view_type_string == kViewTypeAppWindow) { | 152 } else if (view_type_string == kViewTypeAppWindow) { |
| 155 view_type = VIEW_TYPE_APP_WINDOW; | 153 view_type = VIEW_TYPE_APP_WINDOW; |
| 156 } else if (view_type_string == kViewTypePanel) { | 154 } else if (view_type_string == kViewTypePanel) { |
| 157 view_type = VIEW_TYPE_PANEL; | 155 view_type = VIEW_TYPE_PANEL; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 174 v8::Local<v8::Value> window = context->Global(); | 172 v8::Local<v8::Value> window = context->Global(); |
| 175 DCHECK(!window.IsEmpty()); | 173 DCHECK(!window.IsEmpty()); |
| 176 v8_views->Set(v8::Integer::New(args.GetIsolate(), v8_index++), window); | 174 v8_views->Set(v8::Integer::New(args.GetIsolate(), v8_index++), window); |
| 177 } | 175 } |
| 178 } | 176 } |
| 179 | 177 |
| 180 args.GetReturnValue().Set(v8_views); | 178 args.GetReturnValue().Set(v8_views); |
| 181 } | 179 } |
| 182 | 180 |
| 183 } // namespace extensions | 181 } // namespace extensions |
| OLD | NEW |