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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 23835007: DevTools: Do not close devtools if there are dirty files in workspace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing final Jeremy's comments Created 7 years, 1 month 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 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 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 } 830 }
831 831
832 void Browser::UpdateDownloadShelfVisibility(bool visible) { 832 void Browser::UpdateDownloadShelfVisibility(bool visible) {
833 if (GetStatusBubble()) 833 if (GetStatusBubble())
834 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); 834 GetStatusBubble()->UpdateDownloadShelfVisibility(visible);
835 } 835 }
836 836
837 /////////////////////////////////////////////////////////////////////////////// 837 ///////////////////////////////////////////////////////////////////////////////
838 838
839 // static 839 // static
840 bool Browser::ShouldRunUnloadEventsHelper(content::WebContents* contents) {
841 if (IsFastTabUnloadEnabled())
842 return chrome::FastUnloadController::ShouldRunUnloadEventsHelper(contents);
843 return chrome::UnloadController::ShouldRunUnloadEventsHelper(contents);
844 }
845
846 // static
840 bool Browser::RunUnloadEventsHelper(WebContents* contents) { 847 bool Browser::RunUnloadEventsHelper(WebContents* contents) {
841 if (IsFastTabUnloadEnabled()) 848 if (IsFastTabUnloadEnabled())
842 return chrome::FastUnloadController::RunUnloadEventsHelper(contents); 849 return chrome::FastUnloadController::RunUnloadEventsHelper(contents);
843 return chrome::UnloadController::RunUnloadEventsHelper(contents); 850 return chrome::UnloadController::RunUnloadEventsHelper(contents);
844 } 851 }
845 852
846 // static 853 // static
847 void Browser::JSOutOfMemoryHelper(WebContents* web_contents) { 854 void Browser::JSOutOfMemoryHelper(WebContents* web_contents) {
848 InfoBarService* infobar_service = 855 InfoBarService* infobar_service =
849 InfoBarService::FromWebContents(web_contents); 856 InfoBarService::FromWebContents(web_contents);
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 return false; 1435 return false;
1429 } 1436 }
1430 1437
1431 gfx::Rect Browser::GetRootWindowResizerRect() const { 1438 gfx::Rect Browser::GetRootWindowResizerRect() const {
1432 return window_->GetRootWindowResizerRect(); 1439 return window_->GetRootWindowResizerRect();
1433 } 1440 }
1434 1441
1435 void Browser::BeforeUnloadFired(WebContents* web_contents, 1442 void Browser::BeforeUnloadFired(WebContents* web_contents,
1436 bool proceed, 1443 bool proceed,
1437 bool* proceed_to_fire_unload) { 1444 bool* proceed_to_fire_unload) {
1445 if (is_devtools() && DevToolsWindow::HandleBeforeUnload(web_contents,
1446 proceed, proceed_to_fire_unload))
1447 return;
1448
1438 if (IsFastTabUnloadEnabled()) { 1449 if (IsFastTabUnloadEnabled()) {
1439 *proceed_to_fire_unload = 1450 *proceed_to_fire_unload =
1440 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed); 1451 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed);
1441 } else { 1452 } else {
1442 *proceed_to_fire_unload = 1453 *proceed_to_fire_unload =
1443 unload_controller_->BeforeUnloadFired(web_contents, proceed); 1454 unload_controller_->BeforeUnloadFired(web_contents, proceed);
1444 } 1455 }
1445 } 1456 }
1446 1457
1447 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { 1458 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) {
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 if (contents && !allow_js_access) { 2287 if (contents && !allow_js_access) {
2277 contents->web_contents()->GetController().LoadURL( 2288 contents->web_contents()->GetController().LoadURL(
2278 target_url, 2289 target_url,
2279 content::Referrer(), 2290 content::Referrer(),
2280 content::PAGE_TRANSITION_LINK, 2291 content::PAGE_TRANSITION_LINK,
2281 std::string()); // No extra headers. 2292 std::string()); // No extra headers.
2282 } 2293 }
2283 2294
2284 return contents != NULL; 2295 return contents != NULL;
2285 } 2296 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698