summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider_list.cc2
-rw-r--r--chrome/browser/automation/automation_provider_list.h1
-rw-r--r--chrome/browser/automation/automation_provider_list_generic.cc8
-rw-r--r--chrome/browser/automation/automation_provider_list_mac.mm13
4 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider_list.cc b/chrome/browser/automation/automation_provider_list.cc
index 4fbc395..9597e7a 100644
--- a/chrome/browser/automation/automation_provider_list.cc
+++ b/chrome/browser/automation/automation_provider_list.cc
@@ -37,6 +37,8 @@ bool AutomationProviderList::RemoveProvider(AutomationProvider* provider) {
(*remove_provider)->Release();
automation_providers_.erase(remove_provider);
g_browser_process->ReleaseModule();
+ if (automation_providers_.empty())
+ OnLastProviderRemoved();
return true;
}
return false;
diff --git a/chrome/browser/automation/automation_provider_list.h b/chrome/browser/automation/automation_provider_list.h
index 5e22d37..bedb6a6 100644
--- a/chrome/browser/automation/automation_provider_list.h
+++ b/chrome/browser/automation/automation_provider_list.h
@@ -37,6 +37,7 @@ class AutomationProviderList {
private:
AutomationProviderList();
+ void OnLastProviderRemoved();
list_type automation_providers_;
static AutomationProviderList* instance_;
diff --git a/chrome/browser/automation/automation_provider_list_generic.cc b/chrome/browser/automation/automation_provider_list_generic.cc
new file mode 100644
index 0000000..868d509
--- /dev/null
+++ b/chrome/browser/automation/automation_provider_list_generic.cc
@@ -0,0 +1,8 @@
+// Copyright (c) 2009 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/automation/automation_provider_list.h"
+
+void AutomationProviderList::OnLastProviderRemoved() {
+}
diff --git a/chrome/browser/automation/automation_provider_list_mac.mm b/chrome/browser/automation/automation_provider_list_mac.mm
new file mode 100644
index 0000000..4d408fd
--- /dev/null
+++ b/chrome/browser/automation/automation_provider_list_mac.mm
@@ -0,0 +1,13 @@
+// Copyright (c) 2009 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/automation/automation_provider_list.h"
+
+#import "chrome/browser/app_controller_mac.h"
+
+void AutomationProviderList::OnLastProviderRemoved() {
+ // We need to explicitly quit the application here because on Mac
+ // the controller holds an additional reference to g_browser_process.
+ [[NSApp delegate] quit:nil];
+}