OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
48 #include "content/public/browser/web_contents_view.h" | 48 #include "content/public/browser/web_contents_view.h" |
49 #include "net/base/network_change_notifier.h" | 49 #include "net/base/network_change_notifier.h" |
50 #include "webkit/glue/glue_serialize.h" | 50 #include "webkit/glue/glue_serialize.h" |
51 | 51 |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 #include "chrome/browser/chromeos/boot_times_loader.h" | 53 #include "chrome/browser/chromeos/boot_times_loader.h" |
54 #endif | 54 #endif |
55 | 55 |
56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
57 #include "base/win/metro.h" | 57 #include "win8/util/win8_util.h" |
58 #endif | 58 #endif |
59 | 59 |
60 #if defined(USE_ASH) | 60 #if defined(USE_ASH) |
61 #include "ash/wm/window_util.h" | 61 #include "ash/wm/window_util.h" |
62 #endif | 62 #endif |
63 using content::NavigationController; | 63 using content::NavigationController; |
64 using content::RenderWidgetHost; | 64 using content::RenderWidgetHost; |
65 using content::WebContents; | 65 using content::WebContents; |
66 | 66 |
67 namespace { | 67 namespace { |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 "SessionRestore-CreateRestoredBrowser-Start", false); | 797 "SessionRestore-CreateRestoredBrowser-Start", false); |
798 #endif | 798 #endif |
799 // Show the first window if none are visible. | 799 // Show the first window if none are visible. |
800 ui::WindowShowState show_state = (*i)->show_state; | 800 ui::WindowShowState show_state = (*i)->show_state; |
801 if (!has_visible_browser) { | 801 if (!has_visible_browser) { |
802 show_state = ui::SHOW_STATE_NORMAL; | 802 show_state = ui::SHOW_STATE_NORMAL; |
803 has_visible_browser = true; | 803 has_visible_browser = true; |
804 } | 804 } |
805 browser = NULL; | 805 browser = NULL; |
806 #if defined(OS_WIN) | 806 #if defined(OS_WIN) |
807 if (base::win::IsMetroProcess()) { | 807 if (win8::IsSingleWindowMetroMode()) { |
808 // We don't want to add tabs to the off the record browser. | 808 // We don't want to add tabs to the off the record browser. |
809 if (browser_ && !browser_->profile()->IsOffTheRecord()) { | 809 if (browser_ && !browser_->profile()->IsOffTheRecord()) { |
810 browser = browser_; | 810 browser = browser_; |
811 } else { | 811 } else { |
812 browser = last_browser; | 812 browser = last_browser; |
813 // last_browser should never be off the record either. | 813 // last_browser should never be off the record either. |
814 // We don't set browser higher above when browser_ is offtherecord, | 814 // We don't set browser higher above when browser_ is offtherecord, |
815 // and CreateRestoredBrowser below, is never created offtherecord. | 815 // and CreateRestoredBrowser below, is never created offtherecord. |
816 DCHECK(!browser || !browser->profile()->IsOffTheRecord()); | 816 DCHECK(!browser || !browser->profile()->IsOffTheRecord()); |
817 } | 817 } |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 if (active_session_restorers == NULL) | 1185 if (active_session_restorers == NULL) |
1186 return false; | 1186 return false; |
1187 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1187 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1188 active_session_restorers->begin(); | 1188 active_session_restorers->begin(); |
1189 it != active_session_restorers->end(); ++it) { | 1189 it != active_session_restorers->end(); ++it) { |
1190 if ((*it)->profile() == profile) | 1190 if ((*it)->profile() == profile) |
1191 return true; | 1191 return true; |
1192 } | 1192 } |
1193 return false; | 1193 return false; |
1194 } | 1194 } |
OLD | NEW |