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

Side by Side Diff: webkit/glue/back_forward_list_client_impl.cc

Issue 196128: Hook up WebViewClient, part 1.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « webkit/api/public/WebViewClient.h ('k') | webkit/glue/chrome_client_impl.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) 2008 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "HistoryItem.h" 7 #include "HistoryItem.h"
8 #undef LOG 8 #undef LOG
9 9
10 #include "webkit/glue/back_forward_list_client_impl.h" 10 #include "webkit/glue/back_forward_list_client_impl.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void BackForwardListClientImpl::addItem(PassRefPtr<WebCore::HistoryItem> item) { 35 void BackForwardListClientImpl::addItem(PassRefPtr<WebCore::HistoryItem> item) {
36 previous_item_ = current_item_; 36 previous_item_ = current_item_;
37 current_item_ = item; 37 current_item_ = item;
38 38
39 // If WebCore adds a new HistoryItem, it means this is a new navigation (ie, 39 // If WebCore adds a new HistoryItem, it means this is a new navigation (ie,
40 // not a reload or back/forward). 40 // not a reload or back/forward).
41 webview_->ObserveNewNavigation(); 41 webview_->ObserveNewNavigation();
42 42
43 if (webview_->delegate()) 43 if (webview_->client())
44 webview_->delegate()->DidAddHistoryItem(); 44 webview_->client()->didAddHistoryItem();
45 } 45 }
46 46
47 void BackForwardListClientImpl::goToItem(WebCore::HistoryItem* item) { 47 void BackForwardListClientImpl::goToItem(WebCore::HistoryItem* item) {
48 previous_item_ = current_item_; 48 previous_item_ = current_item_;
49 current_item_ = item; 49 current_item_ = item;
50 50
51 if (pending_history_item_ == item) 51 if (pending_history_item_ == item)
52 pending_history_item_ = NULL; 52 pending_history_item_ = NULL;
53 } 53 }
54 54
(...skipping 16 matching lines...) Expand all
71 71
72 WebCore::String url_string = WebCore::String::format( 72 WebCore::String url_string = WebCore::String::format(
73 "%s://go/%d", kBackForwardNavigationScheme, index); 73 "%s://go/%d", kBackForwardNavigationScheme, index);
74 74
75 pending_history_item_ = 75 pending_history_item_ =
76 WebCore::HistoryItem::create(url_string, WebCore::String(), 0.0); 76 WebCore::HistoryItem::create(url_string, WebCore::String(), 0.0);
77 return pending_history_item_.get(); 77 return pending_history_item_.get();
78 } 78 }
79 79
80 int BackForwardListClientImpl::backListCount() { 80 int BackForwardListClientImpl::backListCount() {
81 if (!webview_->delegate()) 81 if (!webview_->client())
82 return 0; 82 return 0;
83 83
84 return webview_->delegate()->GetHistoryBackListCount(); 84 return webview_->client()->historyBackListCount();
85 } 85 }
86 86
87 int BackForwardListClientImpl::forwardListCount() { 87 int BackForwardListClientImpl::forwardListCount() {
88 if (!webview_->delegate()) 88 if (!webview_->client())
89 return 0; 89 return 0;
90 90
91 return webview_->delegate()->GetHistoryForwardListCount(); 91 return webview_->client()->historyForwardListCount();
92 } 92 }
93 93
94 void BackForwardListClientImpl::close() { 94 void BackForwardListClientImpl::close() {
95 current_item_ = NULL; 95 current_item_ = NULL;
96 previous_item_ = NULL; 96 previous_item_ = NULL;
97 pending_history_item_ = NULL; 97 pending_history_item_ = NULL;
98 } 98 }
99 99
100 } // namespace webkit_glue 100 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/api/public/WebViewClient.h ('k') | webkit/glue/chrome_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698