summaryrefslogtreecommitdiffstats
path: root/chrome/browser/session_crashed_view.cc
blob: 6d0f15f48744e8ba3654fad75bb556a77d9d52b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/session_crashed_view.h"

#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/session_restore.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"

#include "chromium_strings.h"
#include "generated_resources.h"

SessionCrashedView::SessionCrashedView(Profile* profile)
    : InfoBarConfirmView(
          l10n_util::GetString(IDS_SESSION_CRASHED_VIEW_MESSAGE)),
      profile_(profile) {
  DCHECK(profile_);
  SetOKButtonLabel(
      l10n_util::GetString(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON));
  RemoveCancelButton();
  ResourceBundle &rb = ResourceBundle::GetSharedInstance();
  SetIcon(*rb.GetBitmapNamed(IDR_INFOBAR_RESTORE_SESSION));
}

SessionCrashedView::~SessionCrashedView() {
}

void SessionCrashedView::OKButtonPressed() {
  // Restore the session.
  SessionRestore::RestoreSession(profile_, false, true, false,
                                 std::vector<GURL>());

  // Close the info bar.
  InfoBarConfirmView::OKButtonPressed();
  // NOTE: OKButtonPressed eventually results in deleting us.
}