| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/infobars/infobar_service.h" | 5 #include "chrome/browser/infobars/infobar_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // InfoBarService::CreateConfirmInfoBar() is implemented in platform-specific | 91 // InfoBarService::CreateConfirmInfoBar() is implemented in platform-specific |
| 92 // files. | 92 // files. |
| 93 | 93 |
| 94 void InfoBarService::RenderProcessGone(base::TerminationStatus status) { | 94 void InfoBarService::RenderProcessGone(base::TerminationStatus status) { |
| 95 RemoveAllInfoBars(true); | 95 RemoveAllInfoBars(true); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void InfoBarService::DidStartNavigation( | 98 void InfoBarService::DidStartNavigation( |
| 99 content::NavigationHandle* navigation_handle) { | 99 content::NavigationHandle* navigation_handle) { |
| 100 if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSamePage()) | 100 if (!navigation_handle->IsInMainFrame() || |
| 101 navigation_handle->IsSameDocument()) { |
| 101 return; | 102 return; |
| 103 } |
| 102 | 104 |
| 103 ignore_next_reload_ = false; | 105 ignore_next_reload_ = false; |
| 104 } | 106 } |
| 105 | 107 |
| 106 void InfoBarService::NavigationEntryCommitted( | 108 void InfoBarService::NavigationEntryCommitted( |
| 107 const content::LoadCommittedDetails& load_details) { | 109 const content::LoadCommittedDetails& load_details) { |
| 108 const bool ignore = ignore_next_reload_ && | 110 const bool ignore = ignore_next_reload_ && |
| 109 ui::PageTransitionCoreTypeIs(load_details.entry->GetTransitionType(), | 111 ui::PageTransitionCoreTypeIs(load_details.entry->GetTransitionType(), |
| 110 ui::PAGE_TRANSITION_RELOAD); | 112 ui::PAGE_TRANSITION_RELOAD); |
| 111 ignore_next_reload_ = false; | 113 ignore_next_reload_ = false; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 127 // A normal user click on an infobar URL will result in a CURRENT_TAB | 129 // A normal user click on an infobar URL will result in a CURRENT_TAB |
| 128 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up | 130 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up |
| 129 // smashing the page the user is looking at. | 131 // smashing the page the user is looking at. |
| 130 web_contents()->OpenURL( | 132 web_contents()->OpenURL( |
| 131 content::OpenURLParams(url, content::Referrer(), | 133 content::OpenURLParams(url, content::Referrer(), |
| 132 (disposition == WindowOpenDisposition::CURRENT_TAB) | 134 (disposition == WindowOpenDisposition::CURRENT_TAB) |
| 133 ? WindowOpenDisposition::NEW_FOREGROUND_TAB | 135 ? WindowOpenDisposition::NEW_FOREGROUND_TAB |
| 134 : disposition, | 136 : disposition, |
| 135 ui::PAGE_TRANSITION_LINK, false)); | 137 ui::PAGE_TRANSITION_LINK, false)); |
| 136 } | 138 } |
| OLD | NEW |