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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // |view_type| == content::VIEW_TYPE_INVALID means getting any type of | 51 // |view_type| == content::VIEW_TYPE_INVALID means getting any type of |
52 // views. | 52 // views. |
53 content::ViewType view_type = content::VIEW_TYPE_INVALID; | 53 content::ViewType view_type = content::VIEW_TYPE_INVALID; |
54 if (view_type_string == chrome::kViewTypeBackgroundPage) { | 54 if (view_type_string == chrome::kViewTypeBackgroundPage) { |
55 view_type = chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; | 55 view_type = chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; |
56 } else if (view_type_string == chrome::kViewTypeInfobar) { | 56 } else if (view_type_string == chrome::kViewTypeInfobar) { |
57 view_type = chrome::VIEW_TYPE_EXTENSION_INFOBAR; | 57 view_type = chrome::VIEW_TYPE_EXTENSION_INFOBAR; |
58 } else if (view_type_string == chrome::kViewTypeNotification) { | 58 } else if (view_type_string == chrome::kViewTypeNotification) { |
59 view_type = chrome::VIEW_TYPE_NOTIFICATION; | 59 view_type = chrome::VIEW_TYPE_NOTIFICATION; |
60 } else if (view_type_string == chrome::kViewTypeTabContents) { | 60 } else if (view_type_string == chrome::kViewTypeTabContents) { |
61 view_type = content::VIEW_TYPE_WEB_CONTENTS; | 61 view_type = chrome::VIEW_TYPE_TAB_CONTENTS; |
62 } else if (view_type_string == chrome::kViewTypePopup) { | 62 } else if (view_type_string == chrome::kViewTypePopup) { |
63 view_type = chrome::VIEW_TYPE_EXTENSION_POPUP; | 63 view_type = chrome::VIEW_TYPE_EXTENSION_POPUP; |
64 } else if (view_type_string == chrome::kViewTypeExtensionDialog) { | 64 } else if (view_type_string == chrome::kViewTypeExtensionDialog) { |
65 view_type = chrome::VIEW_TYPE_EXTENSION_DIALOG; | 65 view_type = chrome::VIEW_TYPE_EXTENSION_DIALOG; |
66 } else if (view_type_string == chrome::kViewTypeAppShell) { | 66 } else if (view_type_string == chrome::kViewTypeAppShell) { |
67 view_type = chrome::VIEW_TYPE_APP_SHELL; | 67 view_type = chrome::VIEW_TYPE_APP_SHELL; |
68 } else if (view_type_string == chrome::kViewTypePanel) { | 68 } else if (view_type_string == chrome::kViewTypePanel) { |
69 view_type = chrome::VIEW_TYPE_PANEL; | 69 view_type = chrome::VIEW_TYPE_PANEL; |
70 } else if (view_type_string != chrome::kViewTypeAll) { | 70 } else if (view_type_string != chrome::kViewTypeAll) { |
71 return v8::Undefined(); | 71 return v8::Undefined(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( | 117 renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( |
118 renderview->GetRoutingID(), | 118 renderview->GetRoutingID(), |
119 source_id, | 119 source_id, |
120 target_id, | 120 target_id, |
121 channel_name, | 121 channel_name, |
122 &port_id)); | 122 &port_id)); |
123 return v8::Integer::New(port_id); | 123 return v8::Integer::New(port_id); |
124 } | 124 } |
125 | 125 |
126 } // namespace extensions | 126 } // namespace extensions |
OLD | NEW |