15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CONTENT_PUBLIC_COMMON_FRAME_NAVIGATE_PARAMS_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CONTENT_PUBLIC_COMMON_FRAME_NAVIGATE_PARAMS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/content_export.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/referrer.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "net/base/host_port_pair.h"
141320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "ui/base/page_transition_types.h"
157dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "url/gurl.h"
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace content {
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Struct used by WebContentsObserver.
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)struct CONTENT_EXPORT FrameNavigateParams {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FrameNavigateParams();
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  ~FrameNavigateParams();
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Page ID of this navigation. The renderer creates a new unique page ID
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // anytime a new session history entry is created. This means you'll get new
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // page IDs for user actions, and the old page IDs will be reloaded when
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // iframes are loaded automatically.
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int32 page_id;
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // URL of the page being loaded.
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GURL url;
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The base URL for the page's document when the frame was committed. Empty if
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // similar to 'url' above. Note that any base element in the page has not been
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // parsed yet and is therefore not reflected.
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // This is of interest when a MHTML file is loaded, as the base URL has been
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // set to original URL of the site the MHTML represents.
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GURL base_url;
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // URL of the referrer of this load. WebKit generates this based on the
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // source of the event that caused the load.
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  content::Referrer referrer;
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The type of transition.
451320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  ui::PageTransition transition;
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Lists the redirects that occurred on the way to the current page. This
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // vector has the same format as reported by the WebDataSource in the glue,
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // with the current page being the last one in the list (so even when
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // there's no redirect, there will be one entry in the list.
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::vector<GURL> redirects;
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Set to false if we want to update the session history but not update
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the browser history.  E.g., on unreachable urls.
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool should_update_history;
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // See SearchableFormData for a description of these.
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GURL searchable_form_url;
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::string searchable_form_encoding;
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Contents MIME type of main frame.
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  std::string contents_mime_type;
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Remote address of the socket which fetched this resource.
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  net::HostPortPair socket_address;
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace content
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CONTENT_PUBLIC_COMMON_FRAME_NAVIGATE_PARAMS_H_
71