summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 22:05:13 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 22:05:13 +0000
commit28191891f2389382e4e53d004e04a74bcb1b152e (patch)
treeba47a955a1347bf43585c6e5c8ae23116eb8b49e /chrome/browser/sessions
parent1f05db25d586c82e8420a8a28c1d0b6a7bcf44e6 (diff)
downloadchromium_src-28191891f2389382e4e53d004e04a74bcb1b152e.zip
chromium_src-28191891f2389382e4e53d004e04a74bcb1b152e.tar.gz
chromium_src-28191891f2389382e4e53d004e04a74bcb1b152e.tar.bz2
Inform the command updater of the tab restore state.
BUG=14428 TEST=TabRestoreUITest.* Review URL: http://codereview.chromium.org/2228004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/session_restore.cc2
-rw-r--r--chrome/browser/sessions/session_service.cc3
-rw-r--r--chrome/browser/sessions/session_types.cc14
-rw-r--r--chrome/browser/sessions/session_types.h13
4 files changed, 22 insertions, 10 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 86b668d..0d60867 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -357,7 +357,7 @@ class SessionRestoreImpl : public NotificationObserver {
}
}
if (!browser) {
- browser = new Browser((*i)->type, profile_);
+ browser = new Browser(static_cast<Browser::Type>((*i)->type), profile_);
browser->set_override_bounds((*i)->bounds);
browser->set_maximized_state((*i)->is_maximized ?
Browser::MAXIMIZED_STATE_MAXIMIZED :
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index f8d422a..ca5f183 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -803,7 +803,8 @@ void SessionService::SortTabsBasedOnVisualOrderAndPrune(
std::map<int, SessionWindow*>::iterator i = windows->begin();
while (i != windows->end()) {
if (i->second->tabs.empty() || i->second->is_constrained ||
- !should_track_changes_for_browser_type(i->second->type)) {
+ !should_track_changes_for_browser_type(
+ static_cast<Browser::Type>(i->second->type))) {
delete i->second;
windows->erase(i++);
} else {
diff --git a/chrome/browser/sessions/session_types.cc b/chrome/browser/sessions/session_types.cc
index 27caf057..6cf193c 100644
--- a/chrome/browser/sessions/session_types.cc
+++ b/chrome/browser/sessions/session_types.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/sessions/session_types.h"
#include "base/string_util.h"
+#include "chrome/browser/browser.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
@@ -37,3 +38,16 @@ void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) {
transition_ = entry.transition_type();
type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0;
}
+
+// SessionWindow ---------------------------------------------------------------
+
+SessionWindow::SessionWindow()
+ : selected_tab_index(-1),
+ type(Browser::TYPE_NORMAL),
+ is_constrained(true),
+ is_maximized(false) {
+}
+
+SessionWindow::~SessionWindow() {
+ STLDeleteElements(&tabs);
+}
diff --git a/chrome/browser/sessions/session_types.h b/chrome/browser/sessions/session_types.h
index 475b99b..f7962da 100644
--- a/chrome/browser/sessions/session_types.h
+++ b/chrome/browser/sessions/session_types.h
@@ -10,7 +10,7 @@
#include "base/stl_util-inl.h"
#include "base/string16.h"
-#include "chrome/browser/browser.h"
+#include "chrome/browser/profile.h"
#include "chrome/browser/sessions/session_id.h"
#include "chrome/common/page_transition_types.h"
#include "gfx/rect.h"
@@ -149,12 +149,8 @@ struct SessionTab {
// Describes a saved window.
struct SessionWindow {
- SessionWindow()
- : selected_tab_index(-1),
- type(Browser::TYPE_NORMAL),
- is_constrained(true),
- is_maximized(false) {}
- ~SessionWindow() { STLDeleteElements(&tabs); }
+ SessionWindow();
+ ~SessionWindow();
// Identifier of the window.
SessionID window_id;
@@ -173,7 +169,8 @@ struct SessionWindow {
// Type of the browser. Currently we only store browsers of type
// TYPE_NORMAL and TYPE_POPUP.
- Browser::Type type;
+ // This would be Browser::Type, but that would cause a circular dependency.
+ int type;
// If true, the window is constrained.
//