OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 blink::WebDataSource::ExtraData* extraData, | 453 blink::WebDataSource::ExtraData* extraData, |
454 const blink::WebURLRequest& request, | 454 const blink::WebURLRequest& request, |
455 blink::WebNavigationType type, | 455 blink::WebNavigationType type, |
456 blink::WebNavigationPolicy default_policy, | 456 blink::WebNavigationPolicy default_policy, |
457 bool is_redirect); | 457 bool is_redirect); |
458 void OpenURL(blink::WebFrame* frame, | 458 void OpenURL(blink::WebFrame* frame, |
459 const GURL& url, | 459 const GURL& url, |
460 const Referrer& referrer, | 460 const Referrer& referrer, |
461 blink::WebNavigationPolicy policy); | 461 blink::WebNavigationPolicy policy); |
462 | 462 |
| 463 // Update current main frame's encoding and send it to browser window. |
| 464 // Since we want to let users see the right encoding info from menu |
| 465 // before finishing loading, we call the UpdateEncoding in |
| 466 // a) function:DidCommitLoadForFrame. When this function is called, |
| 467 // that means we have got first data. In here we try to get encoding |
| 468 // of page if it has been specified in http header. |
| 469 // b) function:DidReceiveTitle. When this function is called, |
| 470 // that means we have got specified title. Because in most of webpages, |
| 471 // title tags will follow meta tags. In here we try to get encoding of |
| 472 // page if it has been specified in meta tag. |
| 473 // c) function:DidFinishDocumentLoadForFrame. When this function is |
| 474 // called, that means we have got whole html page. In here we should |
| 475 // finally get right encoding of page. |
| 476 void UpdateEncoding(blink::WebFrame* frame, |
| 477 const std::string& encoding_name); |
| 478 |
463 // Dispatches the current state of selection on the webpage to the browser if | 479 // Dispatches the current state of selection on the webpage to the browser if |
464 // it has changed. | 480 // it has changed. |
465 // TODO(varunjain): delete this method once we figure out how to keep | 481 // TODO(varunjain): delete this method once we figure out how to keep |
466 // selection handles in sync with the webpage. | 482 // selection handles in sync with the webpage. |
467 void SyncSelectionIfRequired(); | 483 void SyncSelectionIfRequired(); |
468 | 484 |
469 // Returns whether |params.selection_text| should be synchronized to the | 485 // Returns whether |params.selection_text| should be synchronized to the |
470 // browser before bringing up the context menu. Static for testing. | 486 // browser before bringing up the context menu. Static for testing. |
471 static bool ShouldUpdateSelectionTextFromContextMenuParams( | 487 static bool ShouldUpdateSelectionTextFromContextMenuParams( |
472 const base::string16& selection_text, | 488 const base::string16& selection_text, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 blink::WebUserMediaClient* web_user_media_client_; | 580 blink::WebUserMediaClient* web_user_media_client_; |
565 | 581 |
566 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 582 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
567 | 583 |
568 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 584 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
569 }; | 585 }; |
570 | 586 |
571 } // namespace content | 587 } // namespace content |
572 | 588 |
573 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 589 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |