summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 16:51:16 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 16:51:16 +0000
commita55a236d08f10df6455356fadbc255a5fe1a1e28 (patch)
treeda7c32c879e2440123e50bbba7dc52f1c21e845c /chrome/browser/cocoa
parenta753f69f1b482e3ebf94a92a3cb34f6c9930eb80 (diff)
downloadchromium_src-a55a236d08f10df6455356fadbc255a5fe1a1e28.zip
chromium_src-a55a236d08f10df6455356fadbc255a5fe1a1e28.tar.gz
chromium_src-a55a236d08f10df6455356fadbc255a5fe1a1e28.tar.bz2
Move into browser/cocoa from browser/
BUG=15475 TEST=none Review URL: http://codereview.chromium.org/155690 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/browser_window_factory.mm36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_factory.mm b/chrome/browser/cocoa/browser_window_factory.mm
new file mode 100644
index 0000000..1dcfd6c0
--- /dev/null
+++ b/chrome/browser/cocoa/browser_window_factory.mm
@@ -0,0 +1,36 @@
+// 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 "base/logging.h"
+#include "chrome/browser/browser.h"
+#include "chrome/browser/browser_window.h"
+#include "chrome/browser/cocoa/browser_window_cocoa.h"
+#include "chrome/browser/cocoa/browser_window_controller.h"
+#include "chrome/browser/cocoa/find_bar_bridge.h"
+
+// Create the controller for the Browser, which handles loading the browser
+// window from the nib. The controller takes ownership of |browser|.
+// static
+BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
+ // TODO(pinkerton): figure out ownership model. If BrowserList keeps track
+ // of the browser windows, it will probably tell us when it needs to go
+ // away, and it seems we need to feed back to that when we get a
+ // performClose: from the UI.
+ BrowserWindowController* controller =
+ [[BrowserWindowController alloc] initWithBrowser:browser];
+ return [controller browserWindow];
+}
+
+// static
+FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
+ // We could push the AddFindBar() call into the FindBarBridge
+ // constructor or the FindBarCocoaController init, but that makes
+ // unit testing difficult, since we would also require a
+ // BrowserWindow object.
+ BrowserWindowCocoa* window =
+ static_cast<BrowserWindowCocoa*>(browser->window());
+ FindBarBridge* bridge = new FindBarBridge();
+ window->AddFindBar(bridge->find_bar_cocoa_controller());
+ return bridge;
+}