| 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/animation.h" | 10 #include "app/animation.h" |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 window_->GetLocationBar()->AcceptInputWithDisposition(disposition); | 1000 window_->GetLocationBar()->AcceptInputWithDisposition(disposition); |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 void Browser::Stop() { | 1003 void Browser::Stop() { |
| 1004 UserMetrics::RecordAction(UserMetricsAction("Stop"), profile_); | 1004 UserMetrics::RecordAction(UserMetricsAction("Stop"), profile_); |
| 1005 GetSelectedTabContents()->Stop(); | 1005 GetSelectedTabContents()->Stop(); |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 void Browser::NewWindow() { | 1008 void Browser::NewWindow() { |
| 1009 UserMetrics::RecordAction(UserMetricsAction("NewWindow"), profile_); | 1009 UserMetrics::RecordAction(UserMetricsAction("NewWindow"), profile_); |
| 1010 Browser::OpenEmptyWindow(profile_->GetOriginalProfile()); | 1010 SessionService* session_service = |
| 1011 profile_->GetOriginalProfile()->GetSessionService(); |
| 1012 if (!session_service || |
| 1013 !session_service->RestoreIfNecessary(std::vector<GURL>())) { |
| 1014 Browser::OpenEmptyWindow(profile_->GetOriginalProfile()); |
| 1015 } |
| 1011 } | 1016 } |
| 1012 | 1017 |
| 1013 void Browser::NewIncognitoWindow() { | 1018 void Browser::NewIncognitoWindow() { |
| 1014 UserMetrics::RecordAction(UserMetricsAction("NewIncognitoWindow"), profile_); | 1019 UserMetrics::RecordAction(UserMetricsAction("NewIncognitoWindow"), profile_); |
| 1015 Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile()); | 1020 Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile()); |
| 1016 } | 1021 } |
| 1017 | 1022 |
| 1018 void Browser::NewProfileWindowByIndex(int index) { | 1023 void Browser::NewProfileWindowByIndex(int index) { |
| 1019 #if defined(OS_WIN) | 1024 #if defined(OS_WIN) |
| 1020 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1025 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| (...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3466 if (TabHasUnloadListener(contents)) { | 3471 if (TabHasUnloadListener(contents)) { |
| 3467 // If the page has unload listeners, then we tell the renderer to fire | 3472 // If the page has unload listeners, then we tell the renderer to fire |
| 3468 // them. Once they have fired, we'll get a message back saying whether | 3473 // them. Once they have fired, we'll get a message back saying whether |
| 3469 // to proceed closing the page or not, which sends us back to this method | 3474 // to proceed closing the page or not, which sends us back to this method |
| 3470 // with the HasUnloadListener bit cleared. | 3475 // with the HasUnloadListener bit cleared. |
| 3471 contents->render_view_host()->FirePageBeforeUnload(false); | 3476 contents->render_view_host()->FirePageBeforeUnload(false); |
| 3472 return true; | 3477 return true; |
| 3473 } | 3478 } |
| 3474 return false; | 3479 return false; |
| 3475 } | 3480 } |
| OLD | NEW |