summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-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
-rw-r--r--chrome/browser/browser.scons8
-rw-r--r--chrome/browser/browser.vcproj4
6 files changed, 36 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];
+}
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons
index 273355e..222f1e6 100644
--- a/chrome/browser/browser.scons
+++ b/chrome/browser/browser.scons
@@ -218,6 +218,8 @@ input_files = ChromeFileList([
'automation/automation_provider.cc',
'automation/automation_provider.h',
'automation/automation_provider_list.cc',
+ 'automation/automation_provider_list_generic.cc',
+ 'automation/automation_provider_list_mac.mm',
'automation/automation_provider_list.h',
'automation/automation_resource_tracker.cc',
'automation/automation_resource_tracker.h',
@@ -778,6 +780,12 @@ if env.Bit('mac'):
'tab_contents/web_contents_view.cc',
)
+if not env.Bit('mac'):
+ # Mac-specific files
+ input_files.Remove(
+ 'automation/automation_provider_list_mac.mm',
+ )
+
if env.Bit('windows'):
env.TypeLibrary('history/history_indexer.idl')
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj
index 2e84c1f..2d792bf 100644
--- a/chrome/browser/browser.vcproj
+++ b/chrome/browser/browser.vcproj
@@ -830,6 +830,10 @@
>
</File>
<File
+ RelativePath=".\automation\automation_provider_list_generic.cc"
+ >
+ </File>
+ <File
RelativePath=".\automation\automation_provider_list.h"
>
</File>