OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1199 |
1200 // The detached bookmark bar has appearance of floating above the | 1200 // The detached bookmark bar has appearance of floating above the |
1201 // web-contents. This does not play nicely with overscroll navigation | 1201 // web-contents. This does not play nicely with overscroll navigation |
1202 // gestures. So disable overscroll navigation when the bookmark bar is in the | 1202 // gestures. So disable overscroll navigation when the bookmark bar is in the |
1203 // detached state and the overscroll effect moves the layers. | 1203 // detached state and the overscroll effect moves the layers. |
1204 if (value == "1" && bookmark_bar_state_ == BookmarkBar::DETACHED) | 1204 if (value == "1" && bookmark_bar_state_ == BookmarkBar::DETACHED) |
1205 return false; | 1205 return false; |
1206 return true; | 1206 return true; |
1207 } | 1207 } |
1208 | 1208 |
| 1209 bool Browser::ShouldSuppressDialogs(WebContents* source, bool before_unload) { |
| 1210 if (before_unload) |
| 1211 return false; |
| 1212 |
| 1213 // In the case where fullscreen was triggered by the web page ("tab |
| 1214 // fullscreen"), do not allow dialogs. This does not affect the case of user- |
| 1215 // initiated fullscreen ("browser fullscreen"). |
| 1216 return exclusive_access_manager_->fullscreen_controller()->IsTabFullscreen(); |
| 1217 } |
| 1218 |
1209 bool Browser::ShouldPreserveAbortedURLs(WebContents* source) { | 1219 bool Browser::ShouldPreserveAbortedURLs(WebContents* source) { |
1210 // Allow failed URLs to stick around in the omnibox on the NTP, but not when | 1220 // Allow failed URLs to stick around in the omnibox on the NTP, but not when |
1211 // other pages have committed. | 1221 // other pages have committed. |
1212 Profile* profile = Profile::FromBrowserContext(source->GetBrowserContext()); | 1222 Profile* profile = Profile::FromBrowserContext(source->GetBrowserContext()); |
1213 if (!profile || !source->GetController().GetLastCommittedEntry()) | 1223 if (!profile || !source->GetController().GetLastCommittedEntry()) |
1214 return false; | 1224 return false; |
1215 GURL committed_url(source->GetController().GetLastCommittedEntry()->GetURL()); | 1225 GURL committed_url(source->GetController().GetLastCommittedEntry()->GetURL()); |
1216 return search::IsNTPURL(committed_url, profile); | 1226 return search::IsNTPURL(committed_url, profile); |
1217 } | 1227 } |
1218 | 1228 |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2602 if (contents && !allow_js_access) { | 2612 if (contents && !allow_js_access) { |
2603 contents->web_contents()->GetController().LoadURL( | 2613 contents->web_contents()->GetController().LoadURL( |
2604 target_url, | 2614 target_url, |
2605 content::Referrer(), | 2615 content::Referrer(), |
2606 ui::PAGE_TRANSITION_LINK, | 2616 ui::PAGE_TRANSITION_LINK, |
2607 std::string()); // No extra headers. | 2617 std::string()); // No extra headers. |
2608 } | 2618 } |
2609 | 2619 |
2610 return contents != NULL; | 2620 return contents != NULL; |
2611 } | 2621 } |
OLD | NEW |