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/browser/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
8 // For GdkScreen | 8 // For GdkScreen |
9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
10 #endif // defined(OS_CHROMEOS) | 10 #endif // defined(OS_CHROMEOS) |
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2445 // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) | 2445 // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) |
2446 // TODO(jungshik): Add a test for the encoding menu to avoid | 2446 // TODO(jungshik): Add a test for the encoding menu to avoid |
2447 // regressing it again. | 2447 // regressing it again. |
2448 if (PageTransition::IsMainFrame(params.transition)) | 2448 if (PageTransition::IsMainFrame(params.transition)) |
2449 contents_mime_type_ = params.contents_mime_type; | 2449 contents_mime_type_ = params.contents_mime_type; |
2450 | 2450 |
2451 NavigationController::LoadCommittedDetails details; | 2451 NavigationController::LoadCommittedDetails details; |
2452 bool did_navigate = controller_.RendererDidNavigate( | 2452 bool did_navigate = controller_.RendererDidNavigate( |
2453 params, extra_invalidate_flags, &details); | 2453 params, extra_invalidate_flags, &details); |
2454 | 2454 |
2455 // Send notification about committed provisional loads. This notification is | |
2456 // different from the NAV_ENTRY_COMMITTED notification which doesn't include | |
2457 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. | |
2458 if (details.type != NavigationType::NAV_IGNORE) { | |
2459 ProvisionalLoadDetails load_details(details.is_main_frame, | |
2460 details.is_in_page, | |
2461 params.url, std::string(), false); | |
2462 load_details.set_transition_type(params.transition); | |
2463 // Whether or not a page transition was triggered by going backward or | |
2464 // forward in the history is only stored in the navigation controller's | |
2465 // entry list. | |
2466 if (did_navigate && | |
2467 (controller_.GetActiveEntry()->transition_type() & | |
2468 PageTransition::FORWARD_BACK)) { | |
2469 load_details.set_transition_type( | |
2470 params.transition | PageTransition::FORWARD_BACK); | |
2471 } | |
2472 NotificationService::current()->Notify( | |
2473 NotificationType::FRAME_PROVISIONAL_LOAD_COMMITTED, | |
2474 Source<NavigationController>(&controller_), | |
2475 Details<ProvisionalLoadDetails>(&load_details)); | |
2476 | |
2477 } | |
2478 | |
2479 // Update history. Note that this needs to happen after the entry is complete, | 2455 // Update history. Note that this needs to happen after the entry is complete, |
2480 // which WillNavigate[Main,Sub]Frame will do before this function is called. | 2456 // which WillNavigate[Main,Sub]Frame will do before this function is called. |
2481 if (params.should_update_history) { | 2457 if (params.should_update_history) { |
2482 // Most of the time, the displayURL matches the loaded URL, but for about: | 2458 // Most of the time, the displayURL matches the loaded URL, but for about: |
2483 // URLs, we use a data: URL as the real value. We actually want to save the | 2459 // URLs, we use a data: URL as the real value. We actually want to save the |
2484 // about: URL to the history db and keep the data: URL hidden. This is what | 2460 // about: URL to the history db and keep the data: URL hidden. This is what |
2485 // the TabContents' URL getter does. | 2461 // the TabContents' URL getter does. |
2486 scoped_refptr<history::HistoryAddPageArgs> add_page_args( | 2462 scoped_refptr<history::HistoryAddPageArgs> add_page_args( |
2487 CreateHistoryAddPageArgs(GetURL(), details, params)); | 2463 CreateHistoryAddPageArgs(GetURL(), details, params)); |
2488 if (!delegate() || | 2464 if (!delegate() || |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3295 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3271 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
3296 } | 3272 } |
3297 | 3273 |
3298 Profile* TabContents::GetProfileForPasswordManager() { | 3274 Profile* TabContents::GetProfileForPasswordManager() { |
3299 return profile(); | 3275 return profile(); |
3300 } | 3276 } |
3301 | 3277 |
3302 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3278 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
3303 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3279 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
3304 } | 3280 } |
OLD | NEW |