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 "chrome/browser/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 static std::string TerminationStatusToString(base::TerminationStatus status) { | 105 static std::string TerminationStatusToString(base::TerminationStatus status) { |
106 switch (status) { | 106 switch (status) { |
107 case base::TERMINATION_STATUS_NORMAL_TERMINATION: | 107 case base::TERMINATION_STATUS_NORMAL_TERMINATION: |
108 return "normal"; | 108 return "normal"; |
109 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: | 109 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: |
110 case base::TERMINATION_STATUS_STILL_RUNNING: | 110 case base::TERMINATION_STATUS_STILL_RUNNING: |
111 return "abnormal"; | 111 return "abnormal"; |
112 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: | 112 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: |
113 return "killed"; | 113 return "killed"; |
114 case base::TERMINATION_STATUS_PROCESS_CRASHED: | 114 case base::TERMINATION_STATUS_PROCESS_CRASHED: |
115 #if defined(OS_ANDROID) | |
116 case base::TERMINATION_STATUS_OOM_PROTECTED: | |
117 #endif | |
118 return "crashed"; | 115 return "crashed"; |
119 case base::TERMINATION_STATUS_MAX_ENUM: | 116 case base::TERMINATION_STATUS_MAX_ENUM: |
120 break; | 117 break; |
121 } | 118 } |
122 NOTREACHED() << "Unknown Termination Status."; | 119 NOTREACHED() << "Unknown Termination Status."; |
123 return "unknown"; | 120 return "unknown"; |
124 } | 121 } |
125 | 122 |
126 static std::string PermissionTypeToString(WebViewPermissionType type) { | 123 static std::string PermissionTypeToString(WebViewPermissionType type) { |
127 switch (type) { | 124 switch (type) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 #endif // defined(ENABLE_FULL_PRINTING) | 179 #endif // defined(ENABLE_FULL_PRINTING) |
183 #endif // defined(ENABLE_PRINTING) | 180 #endif // defined(ENABLE_PRINTING) |
184 PDFTabHelper::CreateForWebContents(contents); | 181 PDFTabHelper::CreateForWebContents(contents); |
185 } | 182 } |
186 | 183 |
187 } // namespace | 184 } // namespace |
188 | 185 |
189 WebViewGuest::WebViewGuest(int guest_instance_id, | 186 WebViewGuest::WebViewGuest(int guest_instance_id, |
190 WebContents* guest_web_contents, | 187 WebContents* guest_web_contents, |
191 const std::string& embedder_extension_id) | 188 const std::string& embedder_extension_id) |
192 : GuestView<WebViewGuest>(guest_instance_id), | 189 : GuestView<WebViewGuest>(guest_instance_id), |
193 script_executor_(new extensions::ScriptExecutor(guest_web_contents, | 190 script_executor_(new extensions::ScriptExecutor(guest_web_contents, |
194 &script_observers_)), | 191 &script_observers_)), |
195 pending_context_menu_request_id_(0), | 192 pending_context_menu_request_id_(0), |
196 next_permission_request_id_(0), | 193 next_permission_request_id_(0), |
197 is_overriding_user_agent_(false), | 194 is_overriding_user_agent_(false), |
198 main_frame_id_(0), | 195 main_frame_id_(0), |
199 chromevox_injected_(false), | 196 chromevox_injected_(false), |
200 find_helper_(this), | 197 find_helper_(this), |
201 javascript_dialog_helper_(this) { | 198 javascript_dialog_helper_(this) { |
202 Init(guest_web_contents, embedder_extension_id); | 199 Init(guest_web_contents, embedder_extension_id); |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 bool allow, | 1582 bool allow, |
1586 const std::string& user_input) { | 1583 const std::string& user_input) { |
1587 WebViewGuest* guest = | 1584 WebViewGuest* guest = |
1588 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1585 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
1589 if (!guest) | 1586 if (!guest) |
1590 return; | 1587 return; |
1591 | 1588 |
1592 if (!allow) | 1589 if (!allow) |
1593 guest->Destroy(); | 1590 guest->Destroy(); |
1594 } | 1591 } |
OLD | NEW |