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/extension_custom_bindings.h" | 5 #include "chrome/renderer/extensions/extension_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/common/chrome_view_type.h" | 10 #include "chrome/common/chrome_view_type.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 if (!args[0]->IsInt32() || !args[1]->IsString()) | 43 if (!args[0]->IsInt32() || !args[1]->IsString()) |
44 return v8::Undefined(); | 44 return v8::Undefined(); |
45 | 45 |
46 // |browser_window_id| == extension_misc::kUnknownWindowId means getting | 46 // |browser_window_id| == extension_misc::kUnknownWindowId means getting |
47 // views attached to any browser window. | 47 // views attached to any browser window. |
48 int browser_window_id = args[0]->Int32Value(); | 48 int browser_window_id = args[0]->Int32Value(); |
49 | 49 |
50 std::string view_type_string = *v8::String::Utf8Value(args[1]->ToString()); | 50 std::string view_type_string = *v8::String::Utf8Value(args[1]->ToString()); |
51 StringToUpperASCII(&view_type_string); | 51 StringToUpperASCII(&view_type_string); |
52 // |view_type| == content::VIEW_TYPE_INVALID means getting any type of | 52 // |view_type| == chrome::VIEW_TYPE_INVALID means getting any type of |
53 // views. | 53 // views. |
54 content::ViewType view_type = content::VIEW_TYPE_INVALID; | 54 chrome::ViewType view_type = chrome::VIEW_TYPE_INVALID; |
55 if (view_type_string == chrome::kViewTypeBackgroundPage) { | 55 if (view_type_string == chrome::kViewTypeBackgroundPage) { |
56 view_type = chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; | 56 view_type = chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; |
57 } else if (view_type_string == chrome::kViewTypeInfobar) { | 57 } else if (view_type_string == chrome::kViewTypeInfobar) { |
58 view_type = chrome::VIEW_TYPE_EXTENSION_INFOBAR; | 58 view_type = chrome::VIEW_TYPE_EXTENSION_INFOBAR; |
59 } else if (view_type_string == chrome::kViewTypeNotification) { | 59 } else if (view_type_string == chrome::kViewTypeNotification) { |
60 view_type = chrome::VIEW_TYPE_NOTIFICATION; | 60 view_type = chrome::VIEW_TYPE_NOTIFICATION; |
61 } else if (view_type_string == chrome::kViewTypeTabContents) { | 61 } else if (view_type_string == chrome::kViewTypeTabContents) { |
62 view_type = chrome::VIEW_TYPE_TAB_CONTENTS; | 62 view_type = chrome::VIEW_TYPE_TAB_CONTENTS; |
63 } else if (view_type_string == chrome::kViewTypePopup) { | 63 } else if (view_type_string == chrome::kViewTypePopup) { |
64 view_type = chrome::VIEW_TYPE_EXTENSION_POPUP; | 64 view_type = chrome::VIEW_TYPE_EXTENSION_POPUP; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( | 118 renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( |
119 renderview->GetRoutingID(), | 119 renderview->GetRoutingID(), |
120 source_id, | 120 source_id, |
121 target_id, | 121 target_id, |
122 channel_name, | 122 channel_name, |
123 &port_id)); | 123 &port_id)); |
124 return v8::Integer::New(port_id); | 124 return v8::Integer::New(port_id); |
125 } | 125 } |
126 | 126 |
127 } // namespace extensions | 127 } // namespace extensions |
OLD | NEW |