| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 // Webkit is asking whether to navigate to a new URL. | 2520 // Webkit is asking whether to navigate to a new URL. |
| 2521 // This is fine normally, except if we're showing UI from one security | 2521 // This is fine normally, except if we're showing UI from one security |
| 2522 // context and they're trying to navigate to a different context. | 2522 // context and they're trying to navigate to a different context. |
| 2523 const GURL& url = request.url(); | 2523 const GURL& url = request.url(); |
| 2524 | 2524 |
| 2525 // If the browser is interested, then give it a chance to look at top level | 2525 // If the browser is interested, then give it a chance to look at top level |
| 2526 // navigations. | 2526 // navigations. |
| 2527 if (renderer_preferences_.browser_handles_top_level_requests && | 2527 if (renderer_preferences_.browser_handles_top_level_requests && |
| 2528 IsNonLocalTopLevelNavigation(url, frame, type)) { | 2528 IsNonLocalTopLevelNavigation(url, frame, type)) { |
| 2529 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer"))); | 2529 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer"))); |
| 2530 // Reset these counters as the RenderView could be reused for the next |
| 2531 // navigation. |
| 2532 page_id_ = -1; |
| 2533 next_page_id_ = 1; |
| 2534 last_page_id_sent_to_browser_ = -1; |
| 2530 OpenURL(url, referrer, default_policy); | 2535 OpenURL(url, referrer, default_policy); |
| 2531 return WebKit::WebNavigationPolicyIgnore; // Suppress the load here. | 2536 return WebKit::WebNavigationPolicyIgnore; // Suppress the load here. |
| 2532 } | 2537 } |
| 2533 | 2538 |
| 2534 // A content initiated navigation may have originated from a link-click, | 2539 // A content initiated navigation may have originated from a link-click, |
| 2535 // script, drag-n-drop operation, etc. | 2540 // script, drag-n-drop operation, etc. |
| 2536 bool is_content_initiated = | 2541 bool is_content_initiated = |
| 2537 NavigationState::FromDataSource(frame->provisionalDataSource())-> | 2542 NavigationState::FromDataSource(frame->provisionalDataSource())-> |
| 2538 is_content_initiated(); | 2543 is_content_initiated(); |
| 2539 | 2544 |
| (...skipping 2999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5539 PendingOpenFileSystem* request = pending_file_system_requests_.Lookup( | 5544 PendingOpenFileSystem* request = pending_file_system_requests_.Lookup( |
| 5540 request_id); | 5545 request_id); |
| 5541 DCHECK(request); | 5546 DCHECK(request); |
| 5542 if (accepted) | 5547 if (accepted) |
| 5543 request->callbacks->didOpenFileSystem(name, root_path); | 5548 request->callbacks->didOpenFileSystem(name, root_path); |
| 5544 else | 5549 else |
| 5545 request->callbacks->didFail(WebKit::WebFileErrorSecurity); | 5550 request->callbacks->didFail(WebKit::WebFileErrorSecurity); |
| 5546 request->callbacks = NULL; | 5551 request->callbacks = NULL; |
| 5547 pending_file_system_requests_.Remove(request_id); | 5552 pending_file_system_requests_.Remove(request_id); |
| 5548 } | 5553 } |
| OLD | NEW |