OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/render_view.h" | 5 #include "content/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 | 1172 |
1173 // Check if the navigation was within the same page, in which case we don't | 1173 // Check if the navigation was within the same page, in which case we don't |
1174 // want to clear the accessibility cache. | 1174 // want to clear the accessibility cache. |
1175 if (accessibility_.get() && !navigation_state->was_within_same_page()) { | 1175 if (accessibility_.get() && !navigation_state->was_within_same_page()) { |
1176 accessibility_.reset(); | 1176 accessibility_.reset(); |
1177 pending_accessibility_notifications_.clear(); | 1177 pending_accessibility_notifications_.clear(); |
1178 } | 1178 } |
1179 } | 1179 } |
1180 | 1180 |
1181 // Tell the embedding application that the title of the active page has changed | 1181 // Tell the embedding application that the title of the active page has changed |
1182 void RenderView::UpdateTitle(WebFrame* frame, const string16& title, | 1182 void RenderView::UpdateTitle(WebFrame* frame, |
| 1183 const string16& title, |
1183 WebTextDirection title_direction) { | 1184 WebTextDirection title_direction) { |
1184 // Ignore all but top level navigations. | 1185 // Ignore all but top level navigations. |
1185 if (frame->parent()) | 1186 if (frame->parent()) |
1186 return; | 1187 return; |
1187 | 1188 |
1188 string16 shortened_title = title.substr(0, content::kMaxTitleChars); | 1189 string16 shortened_title = title.substr(0, content::kMaxTitleChars); |
1189 Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title, | 1190 Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title, |
1190 title_direction)); | 1191 title_direction)); |
1191 } | 1192 } |
1192 | 1193 |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 // existing navigation state to a content-initiated navigation state. | 2600 // existing navigation state to a content-initiated navigation state. |
2600 // DidCreateDataSource conveniently takes care of this for us. | 2601 // DidCreateDataSource conveniently takes care of this for us. |
2601 didCreateDataSource(frame, frame->dataSource()); | 2602 didCreateDataSource(frame, frame->dataSource()); |
2602 | 2603 |
2603 NavigationState* new_state = | 2604 NavigationState* new_state = |
2604 NavigationState::FromDataSource(frame->dataSource()); | 2605 NavigationState::FromDataSource(frame->dataSource()); |
2605 new_state->set_was_within_same_page(true); | 2606 new_state->set_was_within_same_page(true); |
2606 | 2607 |
2607 didCommitProvisionalLoad(frame, is_new_navigation); | 2608 didCommitProvisionalLoad(frame, is_new_navigation); |
2608 | 2609 |
2609 UpdateTitle(frame, frame->view()->mainFrame()->dataSource()->pageTitle(), | 2610 WebDataSource* datasource = frame->view()->mainFrame()->dataSource(); |
2610 frame->view()->mainFrame()->dataSource()->pageTitleDirection()); | 2611 UpdateTitle(frame, datasource->pageTitle(), datasource->pageTitleDirection()); |
2611 } | 2612 } |
2612 | 2613 |
2613 void RenderView::didUpdateCurrentHistoryItem(WebFrame* frame) { | 2614 void RenderView::didUpdateCurrentHistoryItem(WebFrame* frame) { |
2614 StartNavStateSyncTimerIfNecessary(); | 2615 StartNavStateSyncTimerIfNecessary(); |
2615 } | 2616 } |
2616 | 2617 |
2617 void RenderView::assignIdentifierToRequest( | 2618 void RenderView::assignIdentifierToRequest( |
2618 WebFrame* frame, unsigned identifier, const WebURLRequest& request) { | 2619 WebFrame* frame, unsigned identifier, const WebURLRequest& request) { |
2619 // Ignore | 2620 // Ignore |
2620 } | 2621 } |
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4432 } | 4433 } |
4433 #endif | 4434 #endif |
4434 | 4435 |
4435 void RenderView::OnContextMenuClosed( | 4436 void RenderView::OnContextMenuClosed( |
4436 const webkit_glue::CustomContextMenuContext& custom_context) { | 4437 const webkit_glue::CustomContextMenuContext& custom_context) { |
4437 if (custom_context.is_pepper_menu) | 4438 if (custom_context.is_pepper_menu) |
4438 pepper_delegate_.OnContextMenuClosed(custom_context); | 4439 pepper_delegate_.OnContextMenuClosed(custom_context); |
4439 else | 4440 else |
4440 context_menu_node_.reset(); | 4441 context_menu_node_.reset(); |
4441 } | 4442 } |
OLD | NEW |