]> khamidou — GitHub mirrors - electron.git/commitdiff
AtomBrowserMainParts is platform-independent now.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 12 Apr 2013 07:57:17 +0000 (15:57 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 12 Apr 2013 07:57:17 +0000 (15:57 +0800)
atom.gyp
browser/atom_browser_main_parts.cc
browser/atom_browser_main_parts_mac.mm [deleted file]

index d965a79c6681b0351d60feb5306d56b1107657fb..e41d724908d0224612311b474a04c1a62fba210c 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
@@ -12,7 +12,6 @@
       'browser/atom_browser_client.h',
       'browser/atom_browser_main_parts.cc',
       'browser/atom_browser_main_parts.h',
-      'browser/atom_browser_main_parts_mac.mm',
       'browser/atom_event_processing_window.h',
       'browser/atom_event_processing_window.mm',
       'browser/native_window.cc',
index 63c50768d5567b311f09e45090f9b1641966ebe9..770a89a6586156d40c5f454c66e9dddd49785ec9 100644 (file)
@@ -4,6 +4,13 @@
 
 #include "browser/atom_browser_main_parts.h"
 
+#include "base/values.h"
+#include "browser/native_window.h"
+#include "brightray/browser/browser_context.h"
+#include "brightray/browser/default_web_contents_delegate.h"
+#include "brightray/browser/inspectable_web_contents.h"
+#include "brightray/browser/inspectable_web_contents_view.h"
+
 namespace atom {
 
 AtomBrowserMainParts::AtomBrowserMainParts() {
@@ -12,4 +19,23 @@ AtomBrowserMainParts::AtomBrowserMainParts() {
 AtomBrowserMainParts::~AtomBrowserMainParts() {
 }
 
+void AtomBrowserMainParts::PreMainMessageLoopRun() {
+  brightray::BrowserMainParts::PreMainMessageLoopRun();
+
+  scoped_ptr<base::DictionaryValue> options(new base::DictionaryValue);
+  options->SetInteger("width", 800);
+  options->SetInteger("height", 600);
+  options->SetString("title", "Atom");
+
+  // FIXME: Leak object here.
+  NativeWindow* window = NativeWindow::Create(browser_context(), options.get());
+  window->InitFromOptions(options.get());
+
+  window->GetWebContents()->GetController().LoadURL(
+      GURL("http://adam.roben.org/brightray_example/start.html"),
+      content::Referrer(),
+      content::PAGE_TRANSITION_AUTO_TOPLEVEL,
+      std::string());
+}
+
 }  // namespace atom
diff --git a/browser/atom_browser_main_parts_mac.mm b/browser/atom_browser_main_parts_mac.mm
deleted file mode 100644 (file)
index ae33180..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "browser/atom_browser_main_parts.h"
-
-#include "base/values.h"
-#include "browser/native_window.h"
-#include "brightray/browser/browser_context.h"
-#include "brightray/browser/default_web_contents_delegate.h"
-#include "brightray/browser/inspectable_web_contents.h"
-#include "brightray/browser/inspectable_web_contents_view.h"
-
-namespace atom {
-
-void AtomBrowserMainParts::PreMainMessageLoopRun() {
-  brightray::BrowserMainParts::PreMainMessageLoopRun();
-
-  scoped_ptr<base::DictionaryValue> options(new base::DictionaryValue);
-  options->SetInteger("width", 800);
-  options->SetInteger("height", 600);
-  options->SetString("title", "Atom");
-
-  // FIXME: Leak object here.
-  NativeWindow* window = NativeWindow::Create(browser_context(), options.get());
-  window->InitFromOptions(options.get());
-
-  window->GetWebContents()->GetController().LoadURL(
-      GURL("http://adam.roben.org/brightray_example/start.html"),
-      content::Referrer(),
-      content::PAGE_TRANSITION_AUTO_TOPLEVEL,
-      std::string());
-}
-
-}  // namespace atom