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

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: revisiting naming & 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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 826
827 void Browser::UpdateDownloadShelfVisibility(bool visible) { 827 void Browser::UpdateDownloadShelfVisibility(bool visible) {
828 if (GetStatusBubble()) 828 if (GetStatusBubble())
829 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); 829 GetStatusBubble()->UpdateDownloadShelfVisibility(visible);
830 } 830 }
831 831
832 /////////////////////////////////////////////////////////////////////////////// 832 ///////////////////////////////////////////////////////////////////////////////
833 833
834 // static 834 // static
835 bool Browser::ShouldRunUnloadEventsHelper(content::WebContents* contents) {
836 if (IsFastTabUnloadEnabled())
837 return chrome::FastUnloadController::ShouldRunUnloadEventsHelper(contents);
838 return chrome::UnloadController::ShouldRunUnloadEventsHelper(contents);
839 }
840
841 // static
835 bool Browser::RunUnloadEventsHelper(WebContents* contents) { 842 bool Browser::RunUnloadEventsHelper(WebContents* contents) {
836 if (IsFastTabUnloadEnabled()) 843 if (IsFastTabUnloadEnabled())
837 return chrome::FastUnloadController::RunUnloadEventsHelper(contents); 844 return chrome::FastUnloadController::RunUnloadEventsHelper(contents);
838 return chrome::UnloadController::RunUnloadEventsHelper(contents); 845 return chrome::UnloadController::RunUnloadEventsHelper(contents);
839 } 846 }
840 847
841 // static 848 // static
842 void Browser::JSOutOfMemoryHelper(WebContents* web_contents) { 849 void Browser::JSOutOfMemoryHelper(WebContents* web_contents) {
843 InfoBarService* infobar_service = 850 InfoBarService* infobar_service =
844 InfoBarService::FromWebContents(web_contents); 851 InfoBarService::FromWebContents(web_contents);
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 return false; 1430 return false;
1424 } 1431 }
1425 1432
1426 gfx::Rect Browser::GetRootWindowResizerRect() const { 1433 gfx::Rect Browser::GetRootWindowResizerRect() const {
1427 return window_->GetRootWindowResizerRect(); 1434 return window_->GetRootWindowResizerRect();
1428 } 1435 }
1429 1436
1430 void Browser::BeforeUnloadFired(WebContents* web_contents, 1437 void Browser::BeforeUnloadFired(WebContents* web_contents,
1431 bool proceed, 1438 bool proceed,
1432 bool* proceed_to_fire_unload) { 1439 bool* proceed_to_fire_unload) {
1440 if (is_devtools() && DevToolsWindow::HandleBeforeUnload(web_contents,
1441 proceed, proceed_to_fire_unload))
1442 return;
1443
1433 if (IsFastTabUnloadEnabled()) { 1444 if (IsFastTabUnloadEnabled()) {
1434 *proceed_to_fire_unload = 1445 *proceed_to_fire_unload =
1435 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed); 1446 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed);
1436 } else { 1447 } else {
1437 *proceed_to_fire_unload = 1448 *proceed_to_fire_unload =
1438 unload_controller_->BeforeUnloadFired(web_contents, proceed); 1449 unload_controller_->BeforeUnloadFired(web_contents, proceed);
1439 } 1450 }
1440 } 1451 }
1441 1452
1442 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { 1453 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) {
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 if (contents && !allow_js_access) { 2282 if (contents && !allow_js_access) {
2272 contents->web_contents()->GetController().LoadURL( 2283 contents->web_contents()->GetController().LoadURL(
2273 target_url, 2284 target_url,
2274 content::Referrer(), 2285 content::Referrer(),
2275 content::PAGE_TRANSITION_LINK, 2286 content::PAGE_TRANSITION_LINK,
2276 std::string()); // No extra headers. 2287 std::string()); // No extra headers.
2277 } 2288 }
2278 2289
2279 return contents != NULL; 2290 return contents != NULL;
2280 } 2291 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698