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

Side by Side Diff: chrome/browser/tab_contents/navigation_controller.cc

Issue 6369003: New extension API: "tab.socketAddress" (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 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
OLDNEW
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/browser/tab_contents/navigation_controller.h" 5 #include "chrome/browser/tab_contents/navigation_controller.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return false; 553 return false;
554 break; 554 break;
555 case NavigationType::NAV_IGNORE: 555 case NavigationType::NAV_IGNORE:
556 // There is nothing we can do with this navigation, so we just return to 556 // There is nothing we can do with this navigation, so we just return to
557 // the caller that nothing has happened. 557 // the caller that nothing has happened.
558 return false; 558 return false;
559 default: 559 default:
560 NOTREACHED(); 560 NOTREACHED();
561 } 561 }
562 562
563 // Capture the latest socket address for every page load.
564 GetActiveEntry()->set_socket_address(params.socket_address);
565
563 // All committed entries should have nonempty content state so WebKit doesn't 566 // All committed entries should have nonempty content state so WebKit doesn't
564 // get confused when we go back to them (see the function for details). 567 // get confused when we go back to them (see the function for details).
565 SetContentStateIfEmpty(GetActiveEntry()); 568 SetContentStateIfEmpty(GetActiveEntry());
566 569
567 // WebKit doesn't set the "auto" transition on meta refreshes properly (bug 570 // WebKit doesn't set the "auto" transition on meta refreshes properly (bug
568 // 1051891) so we manually set it for redirects which we normally treat as 571 // 1051891) so we manually set it for redirects which we normally treat as
569 // "non-user-gestures" where we want to update stuff after navigations. 572 // "non-user-gestures" where we want to update stuff after navigations.
570 // 573 //
571 // Note that the redirect check also checks for a pending entry to 574 // Note that the redirect check also checks for a pending entry to
572 // differentiate real redirects from browser initiated navigations to a 575 // differentiate real redirects from browser initiated navigations to a
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 size_t insert_index = 0; 1197 size_t insert_index = 0;
1195 for (int i = 0; i < max_index; i++) { 1198 for (int i = 0; i < max_index; i++) {
1196 // When cloning a tab, copy all entries except interstitial pages 1199 // When cloning a tab, copy all entries except interstitial pages
1197 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { 1200 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) {
1198 entries_.insert(entries_.begin() + insert_index++, 1201 entries_.insert(entries_.begin() + insert_index++,
1199 linked_ptr<NavigationEntry>( 1202 linked_ptr<NavigationEntry>(
1200 new NavigationEntry(*source.entries_[i]))); 1203 new NavigationEntry(*source.entries_[i])));
1201 } 1204 }
1202 } 1205 }
1203 } 1206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698