| 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 "components/html_viewer/html_document.h" | 5 #include "components/html_viewer/html_document.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 312 |
| 313 ChildFrameData child_frame_data; | 313 ChildFrameData child_frame_data; |
| 314 child_frame_data.view = child_frame_view; | 314 child_frame_data.view = child_frame_view; |
| 315 child_frame_data.scope = scope; | 315 child_frame_data.scope = scope; |
| 316 frame_to_view_[child_frame] = child_frame_data; | 316 frame_to_view_[child_frame] = child_frame_data; |
| 317 } | 317 } |
| 318 return child_frame; | 318 return child_frame; |
| 319 } | 319 } |
| 320 | 320 |
| 321 void HTMLDocument::frameDetached(blink::WebFrame* frame) { | 321 void HTMLDocument::frameDetached(blink::WebFrame* frame) { |
| 322 frameDetached(frame, DetachType::Remove); | |
| 323 } | |
| 324 | |
| 325 void HTMLDocument::frameDetached(blink::WebFrame* frame, DetachType type) { | |
| 326 DCHECK(type == DetachType::Remove); | |
| 327 if (frame->parent()) | 322 if (frame->parent()) |
| 328 frame->parent()->removeChild(frame); | 323 frame->parent()->removeChild(frame); |
| 329 | 324 |
| 330 // |frame| is invalid after here. | 325 // |frame| is invalid after here. |
| 331 frame->close(); | 326 frame->close(); |
| 332 } | 327 } |
| 333 | 328 |
| 334 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) { | 329 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) { |
| 335 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar. | 330 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar. |
| 336 // Either it should, as it once did, or we should find another solution here. | 331 // Either it should, as it once did, or we should find another solution here. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 touch_handler_->OnTouchEvent(*event); | 429 touch_handler_->OnTouchEvent(*event); |
| 435 return; | 430 return; |
| 436 } | 431 } |
| 437 scoped_ptr<blink::WebInputEvent> web_event = | 432 scoped_ptr<blink::WebInputEvent> web_event = |
| 438 event.To<scoped_ptr<blink::WebInputEvent>>(); | 433 event.To<scoped_ptr<blink::WebInputEvent>>(); |
| 439 if (web_event) | 434 if (web_event) |
| 440 web_view_->handleInputEvent(*web_event); | 435 web_view_->handleInputEvent(*web_event); |
| 441 } | 436 } |
| 442 | 437 |
| 443 } // namespace html_viewer | 438 } // namespace html_viewer |
| OLD | NEW |