summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/download/download_util.cc4
-rw-r--r--chrome/browser/profile.cc26
2 files changed, 11 insertions, 19 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index a0cd265..34b62df 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -619,12 +619,12 @@ void UpdateAppIconDownloadProgress(int download_count,
for (BrowserList::const_iterator browser_iterator = BrowserList::begin();
browser_iterator != BrowserList::end(); browser_iterator++) {
HWND frame = (*browser_iterator)->window()->GetNativeHandle();
- if (download_count == 0 || progress == 1.0f)
+ /*if (download_count == 0 || progress == 1.0f)
taskbar->SetProgressState(frame, TBPF_NOPROGRESS);
else if (!progress_known)
taskbar->SetProgressState(frame, TBPF_INDETERMINATE);
else
- taskbar->SetProgressValue(frame, (int)(progress * 100), 100);
+ taskbar->SetProgressValue(frame, (int)(progress * 100), 100);*/
}
#endif
}
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 0478e5c..9ac5a72 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -115,7 +115,7 @@ bool Profile::IsSyncAccessible() {
//
////////////////////////////////////////////////////////////////////////////////
class OffTheRecordProfileImpl : public Profile,
- public NotificationObserver {
+ public BrowserList::Observer {
public:
explicit OffTheRecordProfileImpl(Profile* real_profile)
: profile_(real_profile),
@@ -123,11 +123,8 @@ class OffTheRecordProfileImpl : public Profile,
request_context_ = ChromeURLRequestContextGetter::CreateOffTheRecord(this);
extension_process_manager_.reset(ExtensionProcessManager::Create(this));
- // Register for browser close notifications so we can detect when the last
- // off-the-record window is closed, in which case we can clean our states
- // (cookies, downloads...).
- registrar_.Add(this, NotificationType::BROWSER_CLOSED,
- NotificationService::AllSources());
+ BrowserList::AddObserver(this);
+
background_contents_service_.reset(
new BackgroundContentsService(this, CommandLine::ForCurrentProcess()));
}
@@ -145,6 +142,8 @@ class OffTheRecordProfileImpl : public Profile,
NewRunnableMethod(
db_tracker_.get(),
&webkit_database::DatabaseTracker::DeleteIncognitoDBDirectory));
+
+ BrowserList::RemoveObserver(this);
}
virtual ProfileId GetRuntimeId() {
@@ -537,18 +536,11 @@ class OffTheRecordProfileImpl : public Profile,
}
}
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- DCHECK_EQ(NotificationType::BROWSER_CLOSED, type.value);
- // We are only interested in OTR browser closing.
- if (Source<Browser>(source)->profile() != this)
- return;
+ virtual void OnBrowserAdded(const Browser* browser) {
+ }
- // Let's check if we still have an Off The Record window opened.
- // Note that we check against 1 as this notification is sent before the
- // browser window is actually removed from the list.
- if (BrowserList::GetBrowserCount(this) <= 1)
+ virtual void OnBrowserRemoved(const Browser* browser) {
+ if (BrowserList::GetBrowserCount(this) == 0)
ExitedOffTheRecordMode();
}