Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: webkit/tools/test_shell/test_navigation_controller.cc

Issue 2983: gtk test shell (Closed)
Patch Set: rebase Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/tools/test_shell/SConscript ('k') | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/tools/test_shell/test_navigation_controller.h" 5 #include "webkit/tools/test_shell/test_navigation_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "webkit/glue/webhistoryitem.h" 8 #include "webkit/glue/webhistoryitem.h"
9 #include "webkit/tools/test_shell/test_shell.h" 9 #include "webkit/tools/test_shell/test_shell.h"
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 TestNavigationEntry::~TestNavigationEntry() { 28 TestNavigationEntry::~TestNavigationEntry() {
29 } 29 }
30 30
31 void TestNavigationEntry::SetContentState(const std::string& state) { 31 void TestNavigationEntry::SetContentState(const std::string& state) {
32 cached_history_item_ = NULL; // invalidate our cached item 32 cached_history_item_ = NULL; // invalidate our cached item
33 state_ = state; 33 state_ = state;
34 } 34 }
35 35
36 WebHistoryItem* TestNavigationEntry::GetHistoryItem() const { 36 WebHistoryItem* TestNavigationEntry::GetHistoryItem() const {
37 #if not defined(OS_LINUX) // TODO(port): temporary hack.
37 if (!cached_history_item_) { 38 if (!cached_history_item_) {
38 TestShellExtraRequestData* extra_data = 39 TestShellExtraRequestData* extra_data =
39 new TestShellExtraRequestData(GetPageID()); 40 new TestShellExtraRequestData(GetPageID());
40 cached_history_item_ = 41 cached_history_item_ =
41 WebHistoryItem::Create(GetURL(), GetTitle(), GetContentState(), 42 WebHistoryItem::Create(GetURL(), GetTitle(), GetContentState(),
42 extra_data); 43 extra_data);
43 } 44 }
45 #endif
44 return cached_history_item_; 46 return cached_history_item_;
45 } 47 }
46 48
47 // ---------------------------------------------------------------------------- 49 // ----------------------------------------------------------------------------
48 // TestNavigationController 50 // TestNavigationController
49 51
50 TestNavigationController::TestNavigationController(TestShell* shell) 52 TestNavigationController::TestNavigationController(TestShell* shell)
51 : pending_entry_(NULL), 53 : pending_entry_(NULL),
52 last_committed_entry_index_(-1), 54 last_committed_entry_index_(-1),
53 pending_entry_index_(-1), 55 pending_entry_index_(-1),
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 DiscardPendingEntry(); 240 DiscardPendingEntry();
239 } 241 }
240 } 242 }
241 243
242 void TestNavigationController::UpdateMaxPageID() { 244 void TestNavigationController::UpdateMaxPageID() {
243 TestNavigationEntry* entry = GetActiveEntry(); 245 TestNavigationEntry* entry = GetActiveEntry();
244 if (entry) 246 if (entry)
245 max_page_id_ = std::max(max_page_id_, entry->GetPageID()); 247 max_page_id_ = std::max(max_page_id_, entry->GetPageID());
246 } 248 }
247 249
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/SConscript ('k') | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698