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 "extensions/browser/guest_view/extension_options/extension_options_gues
t.h" | 5 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t.h" |
6 | 6 |
7 #include "base/metrics/user_metrics.h" | 7 #include "base/metrics/user_metrics.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "components/crx_file/id_util.h" | 9 #include "components/crx_file/id_util.h" |
10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 false)); | 233 false)); |
234 } | 234 } |
235 return false; | 235 return false; |
236 } | 236 } |
237 | 237 |
238 void ExtensionOptionsGuest::DidNavigateMainFrame( | 238 void ExtensionOptionsGuest::DidNavigateMainFrame( |
239 const content::LoadCommittedDetails& details, | 239 const content::LoadCommittedDetails& details, |
240 const content::FrameNavigateParams& params) { | 240 const content::FrameNavigateParams& params) { |
241 if (attached() && (params.url.GetOrigin() != options_page_.GetOrigin())) { | 241 if (attached() && (params.url.GetOrigin() != options_page_.GetOrigin())) { |
242 base::RecordAction(base::UserMetricsAction("BadMessageTerminate_EOG")); | 242 base::RecordAction(base::UserMetricsAction("BadMessageTerminate_EOG")); |
243 base::KillProcess( | 243 web_contents()->GetRenderProcessHost()->Shutdown( |
244 web_contents()->GetRenderProcessHost()->GetHandle(), | |
245 content::RESULT_CODE_KILLED_BAD_MESSAGE, false /* wait */); | 244 content::RESULT_CODE_KILLED_BAD_MESSAGE, false /* wait */); |
246 } | 245 } |
247 } | 246 } |
248 | 247 |
249 bool ExtensionOptionsGuest::OnMessageReceived(const IPC::Message& message) { | 248 bool ExtensionOptionsGuest::OnMessageReceived(const IPC::Message& message) { |
250 bool handled = true; | 249 bool handled = true; |
251 IPC_BEGIN_MESSAGE_MAP(ExtensionOptionsGuest, message) | 250 IPC_BEGIN_MESSAGE_MAP(ExtensionOptionsGuest, message) |
252 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 251 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
253 IPC_MESSAGE_UNHANDLED(handled = false) | 252 IPC_MESSAGE_UNHANDLED(handled = false) |
254 IPC_END_MESSAGE_MAP() | 253 IPC_END_MESSAGE_MAP() |
(...skipping 25 matching lines...) Expand all Loading... |
280 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 279 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
281 | 280 |
282 // Call SetAutoSize to apply all the appropriate validation and clipping of | 281 // Call SetAutoSize to apply all the appropriate validation and clipping of |
283 // values. | 282 // values. |
284 SetAutoSize(auto_size_enabled, | 283 SetAutoSize(auto_size_enabled, |
285 gfx::Size(min_width, min_height), | 284 gfx::Size(min_width, min_height), |
286 gfx::Size(max_width, max_height)); | 285 gfx::Size(max_width, max_height)); |
287 } | 286 } |
288 | 287 |
289 } // namespace extensions | 288 } // namespace extensions |
OLD | NEW |