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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // this back to private member. | 334 // this back to private member. |
335 void OnNavigate(const FrameMsg_Navigate_Params& params); | 335 void OnNavigate(const FrameMsg_Navigate_Params& params); |
336 | 336 |
337 protected: | 337 protected: |
338 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); | 338 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
339 | 339 |
340 private: | 340 private: |
341 friend class RenderFrameObserver; | 341 friend class RenderFrameObserver; |
342 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | 342 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
343 ShouldUpdateSelectionTextFromContextMenuParams); | 343 ShouldUpdateSelectionTextFromContextMenuParams); |
| 344 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 345 GetOriginalRequestUrlViaLoadData); |
| 346 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 347 GetOriginalRequestUrlViaLoadUrlWithoutRedirects); |
| 348 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 349 GetOriginalRequestUrlViaLoadUrlWithRedirects); |
344 | 350 |
345 typedef std::map<GURL, double> HostZoomLevels; | 351 typedef std::map<GURL, double> HostZoomLevels; |
346 | 352 |
347 // Functions to add and remove observers for this object. | 353 // Functions to add and remove observers for this object. |
348 void AddObserver(RenderFrameObserver* observer); | 354 void AddObserver(RenderFrameObserver* observer); |
349 void RemoveObserver(RenderFrameObserver* observer); | 355 void RemoveObserver(RenderFrameObserver* observer); |
350 | 356 |
351 void UpdateURL(blink::WebFrame* frame); | 357 void UpdateURL(blink::WebFrame* frame); |
352 | 358 |
353 // IPC message handlers ------------------------------------------------------ | 359 // IPC message handlers ------------------------------------------------------ |
(...skipping 10 matching lines...) Expand all Loading... |
364 unsigned action); | 370 unsigned action); |
365 | 371 |
366 // Returns whether |params.selection_text| should be synchronized to the | 372 // Returns whether |params.selection_text| should be synchronized to the |
367 // browser before bringing up the context menu. Static for testing. | 373 // browser before bringing up the context menu. Static for testing. |
368 static bool ShouldUpdateSelectionTextFromContextMenuParams( | 374 static bool ShouldUpdateSelectionTextFromContextMenuParams( |
369 const base::string16& selection_text, | 375 const base::string16& selection_text, |
370 size_t selection_text_offset, | 376 size_t selection_text_offset, |
371 const gfx::Range& selection_range, | 377 const gfx::Range& selection_range, |
372 const ContextMenuParams& params); | 378 const ContextMenuParams& params); |
373 | 379 |
| 380 // Returns the original request url. If there is no redirect, the original |
| 381 // url is the same as ds->request()->url(). If the WebDataSource belongs to a |
| 382 // frame was loaded by loadData, the original url will be ds->unreachableURL() |
| 383 static GURL GetOriginalRequestUrl(blink::WebDataSource* ds); |
| 384 |
374 // Stores the WebFrame we are associated with. | 385 // Stores the WebFrame we are associated with. |
375 blink::WebFrame* frame_; | 386 blink::WebFrame* frame_; |
376 | 387 |
377 base::WeakPtr<RenderViewImpl> render_view_; | 388 base::WeakPtr<RenderViewImpl> render_view_; |
378 int routing_id_; | 389 int routing_id_; |
379 bool is_swapped_out_; | 390 bool is_swapped_out_; |
380 bool is_detaching_; | 391 bool is_detaching_; |
381 | 392 |
382 #if defined(ENABLE_PLUGINS) | 393 #if defined(ENABLE_PLUGINS) |
383 // Current text input composition text. Empty if no composition is in | 394 // Current text input composition text. Empty if no composition is in |
(...skipping 20 matching lines...) Expand all Loading... |
404 // always respond properly to the request, so we don't have to worry so | 415 // always respond properly to the request, so we don't have to worry so |
405 // much about leaks. | 416 // much about leaks. |
406 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; | 417 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; |
407 | 418 |
408 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 419 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
409 }; | 420 }; |
410 | 421 |
411 } // namespace content | 422 } // namespace content |
412 | 423 |
413 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 424 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |