summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-22 15:38:50 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-22 15:38:50 +0000
commitfa6a910e5401983a7faa0489e7a26643fd7a2c0a (patch)
tree6f1ec4ca19504eb68f9a1758d96ad9c0b3ffc420 /chrome/browser/sessions
parenta49d38f9ddf0b93844f3a7b0fe3d2e2a931e67be (diff)
downloadchromium_src-fa6a910e5401983a7faa0489e7a26643fd7a2c0a.zip
chromium_src-fa6a910e5401983a7faa0489e7a26643fd7a2c0a.tar.gz
chromium_src-fa6a910e5401983a7faa0489e7a26643fd7a2c0a.tar.bz2
Add "open as window" menu item to NTP app menu.
BUG=59697 TEST=BrowserTest.OpenAppWindowLikeNtp,SessionRestoreUITest.RestoreAfterClosing* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66646 Review URL: http://codereview.chromium.org/5019005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/session_restore.cc54
1 files changed, 1 insertions, 53 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 6f38e51..3417215 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -272,8 +272,7 @@ class SessionRestoreImpl : public NotificationObserver {
synchronous_(synchronous),
clobber_existing_window_(clobber_existing_window),
always_create_tabbed_browser_(always_create_tabbed_browser),
- urls_to_open_(urls_to_open),
- waiting_for_extension_service_(false) {
+ urls_to_open_(urls_to_open) {
}
void Restore() {
@@ -339,19 +338,6 @@ class SessionRestoreImpl : public NotificationObserver {
delete this;
return;
- case NotificationType::EXTENSIONS_READY: {
- if (!waiting_for_extension_service_)
- return;
-
- waiting_for_extension_service_ = false;
- if (synchronous_) {
- MessageLoop::current()->Quit();
- return;
- }
- ProcessSessionWindows(&windows_);
- return;
- }
-
default:
NOTREACHED();
break;
@@ -396,18 +382,6 @@ class SessionRestoreImpl : public NotificationObserver {
void OnGotSession(SessionService::Handle handle,
std::vector<SessionWindow*>* windows) {
- if (HasExtensionApps(*windows) && profile_->GetExtensionsService() &&
- !profile_->GetExtensionsService()->is_ready()) {
- // At least one tab is an app tab and the extension service hasn't
- // finished loading. Wait to continue processing until the extensions
- // service finishes loading.
- registrar_.Add(this, NotificationType::EXTENSIONS_READY,
- Source<Profile>(profile_));
- windows_.swap(*windows);
- waiting_for_extension_service_ = true;
- return;
- }
-
if (synchronous_) {
// See comment above windows_ as to why we don't process immediately.
windows_.swap(*windows);
@@ -418,28 +392,6 @@ class SessionRestoreImpl : public NotificationObserver {
ProcessSessionWindows(windows);
}
- // Returns true if any tab in |windows| has an application extension id.
- bool HasExtensionApps(const std::vector<SessionWindow*>& windows) {
- for (std::vector<SessionWindow*>::const_iterator i = windows.begin();
- i != windows.end(); ++i) {
- if (HasExtensionApps((*i)->tabs))
- return true;
- }
-
- return false;
- }
-
- // Returns true if any tab in |tabs| has an application extension id.
- bool HasExtensionApps(const std::vector<SessionTab*>& tabs) {
- for (std::vector<SessionTab*>::const_iterator i = tabs.begin();
- i != tabs.end(); ++i) {
- if (!(*i)->extension_app_id.empty())
- return true;
- }
-
- return false;
- }
-
void ProcessSessionWindows(std::vector<SessionWindow*>* windows) {
if (windows->empty()) {
// Restore was unsuccessful.
@@ -601,10 +553,6 @@ class SessionRestoreImpl : public NotificationObserver {
// windows when the nested message loop exits.
std::vector<SessionWindow*> windows_;
- // If true, indicates at least one tab has an application extension id and
- // we're waiting for the extension service to finish loading.
- bool waiting_for_extension_service_;
-
NotificationRegistrar registrar_;
};