[safe_browsing] Remove unused ContainsBrowseUrl() parameter.
[chromium-blink-merge.git] / content / renderer / history_entry.h
blobf8cc14d5d6b33667a98fec6b9372fa57e0a306c3
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
3 // found in the LICENSE file.
5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
8 * (http://www.torchmobile.com/)
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
20 * its contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #ifndef CONTENT_RENDERER_HISTORY_ENTRY_H_
36 #define CONTENT_RENDERER_HISTORY_ENTRY_H_
38 #include "base/containers/hash_tables.h"
39 #include "base/memory/scoped_ptr.h"
40 #include "base/memory/scoped_vector.h"
41 #include "third_party/WebKit/public/platform/WebURLRequest.h"
42 #include "third_party/WebKit/public/web/WebHistoryItem.h"
44 namespace blink {
45 class WebFrame;
48 namespace content {
49 class RenderFrameImpl;
50 class RenderViewImpl;
52 const int kInvalidFrameRoutingID = -1;
54 class HistoryEntry {
55 public:
56 class HistoryNode {
57 public:
58 HistoryNode(HistoryEntry* entry,
59 const blink::WebHistoryItem& item,
60 int64_t frame_id);
61 ~HistoryNode();
63 HistoryNode* AddChild(const blink::WebHistoryItem& item, int64_t frame_id);
64 HistoryNode* CloneAndReplace(HistoryEntry* new_entry,
65 const blink::WebHistoryItem& new_item,
66 bool clone_children_of_target,
67 RenderFrameImpl* target_frame,
68 RenderFrameImpl* current_frame);
69 blink::WebHistoryItem& item() { return item_; }
70 void set_item(const blink::WebHistoryItem& item) { item_ = item; }
71 std::vector<HistoryNode*>& children() const { return children_->get(); }
72 void RemoveChildren();
74 private:
75 HistoryEntry* entry_;
76 scoped_ptr<ScopedVector<HistoryNode> > children_;
77 blink::WebHistoryItem item_;
80 HistoryEntry(const blink::WebHistoryItem& root, int64_t frame_id);
81 ~HistoryEntry();
83 HistoryEntry* CloneAndReplace(const blink::WebHistoryItem& newItem,
84 bool clone_children_of_target,
85 RenderFrameImpl* target_frame,
86 RenderViewImpl* render_view);
88 HistoryNode* GetHistoryNodeForFrame(RenderFrameImpl* frame);
89 blink::WebHistoryItem GetItemForFrame(RenderFrameImpl* frame);
90 const blink::WebHistoryItem& root() const { return root_->item(); }
91 HistoryNode* root_history_node() const { return root_.get(); }
93 private:
94 HistoryEntry();
96 scoped_ptr<HistoryNode> root_;
98 typedef base::hash_map<uint64_t, HistoryNode*> FramesToItems;
99 FramesToItems frames_to_items_;
101 typedef base::hash_map<std::string, HistoryNode*> UniqueNamesToItems;
102 UniqueNamesToItems unique_names_to_items_;
105 } // namespace content
107 #endif // CONTENT_RENDERER_HISTORY_ENTRY_H_