summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben <ben@chromium.org>2015-08-20 22:42:19 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-21 05:43:14 +0000
commit8b6d44905b342fed774df5b43a1774f8007dfb11 (patch)
tree52cbed13e1a0289a11a288eb92e8e3122207a915
parent2bd10411624467d8b53e2879719c20816017fb27 (diff)
downloadchromium_src-8b6d44905b342fed774df5b43a1774f8007dfb11.zip
chromium_src-8b6d44905b342fed774df5b43a1774f8007dfb11.tar.gz
chromium_src-8b6d44905b342fed774df5b43a1774f8007dfb11.tar.bz2
Rename mandoline/ui/browser -> mandoline/ui/desktop_ui
DesktopUI class -> BrowserWindow. Remove the BrowserUI interface. BrowserManager now manages BrowserWindows. Much simpler! TBR=sky@chromium.org BUG=none Review URL: https://codereview.chromium.org/1305943003 Cr-Commit-Position: refs/heads/master@{#344687}
-rw-r--r--mandoline/BUILD.gn5
-rw-r--r--mandoline/app/android/BUILD.gn2
-rw-r--r--mandoline/app/android/mandoline_activity.cc2
-rw-r--r--mandoline/app/core_services_initialization.cc6
-rw-r--r--mandoline/app/desktop/launcher_process.cc2
-rw-r--r--mandoline/services/core_services/BUILD.gn2
-rw-r--r--mandoline/services/core_services/application_delegate_factory_aura.cc4
-rw-r--r--mandoline/ui/BUILD.gn2
-rw-r--r--mandoline/ui/browser/browser_ui.h32
-rw-r--r--mandoline/ui/desktop_ui/BUILD.gn (renamed from mandoline/ui/browser/BUILD.gn)21
-rw-r--r--mandoline/ui/desktop_ui/DEPS (renamed from mandoline/ui/browser/DEPS)0
-rw-r--r--mandoline/ui/desktop_ui/browser_apptest.cc (renamed from mandoline/ui/browser/browser_apptest.cc)0
-rw-r--r--mandoline/ui/desktop_ui/browser_manager.cc (renamed from mandoline/ui/browser/browser_manager.cc)12
-rw-r--r--mandoline/ui/desktop_ui/browser_manager.h (renamed from mandoline/ui/browser/browser_manager.h)18
-rw-r--r--mandoline/ui/desktop_ui/browser_window.cc (renamed from mandoline/ui/browser/desktop/desktop_ui.cc)78
-rw-r--r--mandoline/ui/desktop_ui/browser_window.h (renamed from mandoline/ui/browser/desktop/desktop_ui.h)38
-rw-r--r--mandoline/ui/desktop_ui/main.cc (renamed from mandoline/ui/browser/main.cc)2
-rw-r--r--mandoline/ui/desktop_ui/public/interfaces/BUILD.gn (renamed from mandoline/ui/browser/public/interfaces/BUILD.gn)0
-rw-r--r--mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom (renamed from mandoline/ui/browser/public/interfaces/launch_handler.mojom)0
-rw-r--r--mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom (renamed from mandoline/ui/browser/public/interfaces/omnibox.mojom)0
-rw-r--r--mandoline/ui/desktop_ui/public/interfaces/view_embedder.mojom (renamed from mandoline/ui/browser/public/interfaces/view_embedder.mojom)0
-rw-r--r--mandoline/ui/omnibox/BUILD.gn2
-rw-r--r--mandoline/ui/omnibox/omnibox_impl.h4
-rw-r--r--mandoline/ui/phone_ui/BUILD.gn2
-rw-r--r--mandoline/ui/phone_ui/phone_browser_application_delegate.h2
25 files changed, 94 insertions, 142 deletions
diff --git a/mandoline/BUILD.gn b/mandoline/BUILD.gn
index d9d75b5..5a308ab 100644
--- a/mandoline/BUILD.gn
+++ b/mandoline/BUILD.gn
@@ -42,9 +42,12 @@ group("tests") {
"//components/resource_provider:resource_provider_unittests",
"//components/view_manager:tests",
"//mandoline/tab:mandoline_frame_apptests",
- "//mandoline/ui/browser:mandoline_browser_apptests",
"//media/mojo/services:tests",
"//sql/mojo:apptests",
]
+
+ if (use_aura) {
+ deps += [ "//mandoline/ui/desktop_ui:mandoline_browser_apptests" ]
+ }
}
}
diff --git a/mandoline/app/android/BUILD.gn b/mandoline/app/android/BUILD.gn
index fdfa9a1..562bc62 100644
--- a/mandoline/app/android/BUILD.gn
+++ b/mandoline/app/android/BUILD.gn
@@ -20,7 +20,7 @@ executable("mandoline_runner") {
deps = [
":jni_headers",
"//base",
- "//mandoline/ui/browser/public/interfaces",
+ "//mandoline/ui/desktop_ui/public/interfaces",
"//mojo/common",
"//mojo/environment:chromium",
"//mojo/runner:lib",
diff --git a/mandoline/app/android/mandoline_activity.cc b/mandoline/app/android/mandoline_activity.cc
index 1bf5ac5..f7e19f6 100644
--- a/mandoline/app/android/mandoline_activity.cc
+++ b/mandoline/app/android/mandoline_activity.cc
@@ -4,7 +4,7 @@
#include "base/android/jni_string.h"
#include "jni/MandolineActivity_jni.h"
-#include "mandoline/ui/browser/public/interfaces/launch_handler.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom.h"
#include "mojo/runner/android/main.h"
#include "mojo/runner/context.h"
diff --git a/mandoline/app/core_services_initialization.cc b/mandoline/app/core_services_initialization.cc
index 3f10387..39e36d9 100644
--- a/mandoline/app/core_services_initialization.cc
+++ b/mandoline/app/core_services_initialization.cc
@@ -32,6 +32,9 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
#endif
#if defined(USE_AURA)
+ manager->RegisterApplicationPackageAlias(GURL("mojo:desktop_ui"),
+ GURL("mojo:core_services"),
+ "Core");
manager->RegisterApplicationPackageAlias(
GURL("mojo:omnibox"), GURL("mojo:core_services"), "Core");
#endif
@@ -39,9 +42,6 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
GURL("mojo:web_view"), GURL("mojo:core_services"), "Core");
manager->RegisterApplicationPackageAlias(
GURL("mojo:tracing"), GURL("mojo:core_services"), "Core");
- manager->RegisterApplicationPackageAlias(GURL("mojo:browser"),
- GURL("mojo:core_services"),
- "Core");
}
} // namespace mandoline
diff --git a/mandoline/app/desktop/launcher_process.cc b/mandoline/app/desktop/launcher_process.cc
index 7cb195a..afa1d15 100644
--- a/mandoline/app/desktop/launcher_process.cc
+++ b/mandoline/app/desktop/launcher_process.cc
@@ -114,7 +114,7 @@ int LauncherProcessMain(int argc, char** argv) {
message_loop.PostTask(FROM_HERE,
base::Bind(&mojo::runner::Context::Run,
base::Unretained(&shell_context),
- GURL("mojo:browser")));
+ GURL("mojo:desktop_ui")));
message_loop.Run();
// Must be called before |message_loop| is destroyed.
diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn
index 27c218e..f0ded5c 100644
--- a/mandoline/services/core_services/BUILD.gn
+++ b/mandoline/services/core_services/BUILD.gn
@@ -74,7 +74,7 @@ source_set("sources") {
if (use_aura) {
deps += [
"//components/view_manager/public/cpp",
- "//mandoline/ui/browser:lib",
+ "//mandoline/ui/desktop_ui:lib",
"//mandoline/ui/omnibox:lib",
]
sources += [ "application_delegate_factory_aura.cc" ]
diff --git a/mandoline/services/core_services/application_delegate_factory_aura.cc b/mandoline/services/core_services/application_delegate_factory_aura.cc
index d02d534..b814dfe 100644
--- a/mandoline/services/core_services/application_delegate_factory_aura.cc
+++ b/mandoline/services/core_services/application_delegate_factory_aura.cc
@@ -4,14 +4,14 @@
#include "mandoline/services/core_services/application_delegate_factory.h"
-#include "mandoline/ui/browser/browser_manager.h"
+#include "mandoline/ui/desktop_ui/browser_manager.h"
#include "mandoline/ui/omnibox/omnibox_impl.h"
namespace core_services {
scoped_ptr<mojo::ApplicationDelegate> CreateApplicationDelegateAura(
const std::string& url) {
- if (url == "mojo://browser/")
+ if (url == "mojo://desktop_ui/")
return make_scoped_ptr(new mandoline::BrowserManager);
else if (url == "mojo://omnibox/")
return make_scoped_ptr(new mandoline::OmniboxImpl);
diff --git a/mandoline/ui/BUILD.gn b/mandoline/ui/BUILD.gn
index f066de5..1c7de33 100644
--- a/mandoline/ui/BUILD.gn
+++ b/mandoline/ui/BUILD.gn
@@ -10,7 +10,7 @@ group("ui") {
]
if (use_aura) {
deps += [
- "browser",
+ "desktop_ui",
"omnibox",
]
}
diff --git a/mandoline/ui/browser/browser_ui.h b/mandoline/ui/browser/browser_ui.h
deleted file mode 100644
index 96f71c0..0000000
--- a/mandoline/ui/browser/browser_ui.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2015 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.
-
-#ifndef MANDOLINE_UI_BROWSER_BROWSER_UI_H_
-#define MANDOLINE_UI_BROWSER_BROWSER_UI_H_
-
-class GURL;
-
-namespace mojo {
-class ApplicationConnection;
-class ApplicationImpl;
-class View;
-}
-
-namespace mandoline {
-
-class BrowserManager;
-
-class BrowserUI {
- public:
- virtual ~BrowserUI() {}
- static BrowserUI* Create(mojo::ApplicationImpl* application_impl,
- BrowserManager* manager);
-
- // Loads the specified URL in the active tab.
- virtual void LoadURL(const GURL& url) = 0;
-};
-
-} // namespace mandoline
-
-#endif // MANDOLINE_UI_BROWSER_BROWSER_UI_H_
diff --git a/mandoline/ui/browser/BUILD.gn b/mandoline/ui/desktop_ui/BUILD.gn
index 24fb5303..dcd3511 100644
--- a/mandoline/ui/browser/BUILD.gn
+++ b/mandoline/ui/desktop_ui/BUILD.gn
@@ -6,7 +6,7 @@ import("//build/config/ui.gni")
import("//mojo/public/mojo_application.gni")
import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
-mojo_native_application("browser") {
+mojo_native_application("desktop_ui") {
sources = [
"main.cc",
]
@@ -24,11 +24,14 @@ source_set("lib") {
sources = [
"browser_manager.cc",
"browser_manager.h",
+ "browser_window.cc",
+ "browser_window.h",
]
deps = [
"public/interfaces",
"//base",
+ "//mandoline/ui/aura",
"//mandoline/tab/public/cpp",
"//mandoline/tab/public/interfaces",
"//mojo/application/public/cpp:sources",
@@ -38,22 +41,12 @@ source_set("lib") {
"//mojo/services/tracing/public/interfaces",
"//skia",
"//third_party/mojo/src/mojo/public/cpp/bindings",
+ "//ui/gfx",
"//ui/gfx/geometry",
"//ui/mojo/events:interfaces",
+ "//ui/views",
"//url",
]
-
- if (is_mac || use_aura) {
- sources += [
- "desktop/desktop_ui.cc",
- "desktop/desktop_ui.h",
- ]
- deps += [
- "//mandoline/ui/aura",
- "//ui/gfx",
- "//ui/views",
- ]
- }
}
mojo_native_application("mandoline_browser_apptests") {
@@ -67,7 +60,7 @@ mojo_native_application("mandoline_browser_apptests") {
"//base",
"//base/test:test_config",
"//components/view_manager/public/cpp",
- "//mandoline/ui/browser:lib",
+ "//mandoline/ui/desktop_ui:lib",
"//mojo/application/public/cpp:sources",
"//mojo/application/public/cpp:test_support",
]
diff --git a/mandoline/ui/browser/DEPS b/mandoline/ui/desktop_ui/DEPS
index 8129a7b..8129a7b 100644
--- a/mandoline/ui/browser/DEPS
+++ b/mandoline/ui/desktop_ui/DEPS
diff --git a/mandoline/ui/browser/browser_apptest.cc b/mandoline/ui/desktop_ui/browser_apptest.cc
index 1f3ba8e..1f3ba8e 100644
--- a/mandoline/ui/browser/browser_apptest.cc
+++ b/mandoline/ui/desktop_ui/browser_apptest.cc
diff --git a/mandoline/ui/browser/browser_manager.cc b/mandoline/ui/desktop_ui/browser_manager.cc
index e98a0fc..2b9ed0e 100644
--- a/mandoline/ui/browser/browser_manager.cc
+++ b/mandoline/ui/desktop_ui/browser_manager.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mandoline/ui/browser/browser_manager.h"
+#include "mandoline/ui/desktop_ui/browser_manager.h"
#include "base/command_line.h"
#include "base/time/time.h"
#include "components/view_manager/public/cpp/view.h"
#include "components/view_manager/public/cpp/view_observer.h"
-#include "mandoline/ui/browser/browser_ui.h"
+#include "mandoline/ui/desktop_ui/browser_window.h"
#include "mojo/services/tracing/public/cpp/switches.h"
#include "mojo/services/tracing/public/interfaces/tracing.mojom.h"
@@ -28,15 +28,15 @@ BrowserManager::~BrowserManager() {
DCHECK(browsers_.empty());
}
-BrowserUI* BrowserManager::CreateBrowser(const GURL& default_url) {
- BrowserUI* browser = BrowserUI::Create(app_, this);
+BrowserWindow* BrowserManager::CreateBrowser(const GURL& default_url) {
+ BrowserWindow* browser = new BrowserWindow(app_, this);
browsers_.insert(browser);
browser->LoadURL(default_url);
return browser;
}
-void BrowserManager::BrowserUIClosed(BrowserUI* browser) {
- scoped_ptr<BrowserUI> browser_owner(browser);
+void BrowserManager::BrowserWindowClosed(BrowserWindow* browser) {
+ scoped_ptr<BrowserWindow> browser_owner(browser);
DCHECK_GT(browsers_.count(browser), 0u);
browsers_.erase(browser);
if (browsers_.empty())
diff --git a/mandoline/ui/browser/browser_manager.h b/mandoline/ui/desktop_ui/browser_manager.h
index 1228149..7b31fc7 100644
--- a/mandoline/ui/browser/browser_manager.h
+++ b/mandoline/ui/desktop_ui/browser_manager.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MANDOLINE_UI_BROWSER_BROWSER_MANAGER_H_
-#define MANDOLINE_UI_BROWSER_BROWSER_MANAGER_H_
+#ifndef MANDOLINE_UI_DESKTOP_UI_BROWSER_MANAGER_H_
+#define MANDOLINE_UI_DESKTOP_UI_BROWSER_MANAGER_H_
#include <set>
#include "base/memory/scoped_vector.h"
-#include "mandoline/ui/browser/public/interfaces/launch_handler.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/application/public/cpp/connect.h"
@@ -21,7 +21,7 @@ class View;
namespace mandoline {
-class BrowserUI;
+class BrowserWindow;
// BrowserManager creates and manages the lifetime of Browsers.
class BrowserManager : public mojo::ApplicationDelegate,
@@ -31,10 +31,10 @@ class BrowserManager : public mojo::ApplicationDelegate,
BrowserManager();
~BrowserManager() override;
- // BrowserManager owns the returned BrowserUI.
- BrowserUI* CreateBrowser(const GURL& default_url);
+ // BrowserManager owns the returned BrowserWindow.
+ BrowserWindow* CreateBrowser(const GURL& default_url);
- void BrowserUIClosed(BrowserUI* browser);
+ void BrowserWindowClosed(BrowserWindow* browser);
private:
// Overridden from LaunchHandler:
@@ -51,11 +51,11 @@ class BrowserManager : public mojo::ApplicationDelegate,
mojo::ApplicationImpl* app_;
mojo::WeakBindingSet<LaunchHandler> launch_handler_bindings_;
- std::set<BrowserUI*> browsers_;
+ std::set<BrowserWindow*> browsers_;
DISALLOW_COPY_AND_ASSIGN(BrowserManager);
};
} // namespace mandoline
-#endif // MANDOLINE_UI_BROWSER_BROWSER_MANAGER_H_
+#endif // MANDOLINE_UI_DESKTOP_UI_BROWSER_MANAGER_H_
diff --git a/mandoline/ui/browser/desktop/desktop_ui.cc b/mandoline/ui/desktop_ui/browser_window.cc
index f062308..4f2718a 100644
--- a/mandoline/ui/browser/desktop/desktop_ui.cc
+++ b/mandoline/ui/desktop_ui/browser_window.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mandoline/ui/browser/desktop/desktop_ui.h"
+#include "mandoline/ui/desktop_ui/browser_window.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "mandoline/ui/aura/native_widget_view_manager.h"
-#include "mandoline/ui/browser/browser_manager.h"
-#include "mandoline/ui/browser/public/interfaces/omnibox.mojom.h"
+#include "mandoline/ui/desktop_ui/browser_manager.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom.h"
#include "mojo/common/common_type_converters.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "ui/gfx/canvas.h"
@@ -57,9 +57,10 @@ class ProgressView : public views::View {
};
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, public:
+// BrowserWindow, public:
-DesktopUI::DesktopUI(mojo::ApplicationImpl* app, BrowserManager* manager)
+BrowserWindow::BrowserWindow(mojo::ApplicationImpl* app,
+ BrowserManager* manager)
: app_(app),
view_manager_init_(app, this, this),
manager_(manager),
@@ -70,12 +71,9 @@ DesktopUI::DesktopUI(mojo::ApplicationImpl* app, BrowserManager* manager)
omnibox_view_(nullptr),
web_view_(this) {}
-DesktopUI::~DesktopUI() {}
+BrowserWindow::~BrowserWindow() {}
-////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, BrowserUI implementation:
-
-void DesktopUI::LoadURL(const GURL& url) {
+void BrowserWindow::LoadURL(const GURL& url) {
// Haven't been embedded yet, can't embed.
// TODO(beng): remove this.
if (!root_) {
@@ -89,10 +87,10 @@ void DesktopUI::LoadURL(const GURL& url) {
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, mojo::ViewManagerDelegate implementation:
+// BrowserWindow, mojo::ViewManagerDelegate implementation:
-void DesktopUI::OnEmbed(mojo::View* root) {
- // DesktopUI does not support being embedded more than once.
+void BrowserWindow::OnEmbed(mojo::View* root) {
+ // BrowserWindow does not support being embedded more than once.
CHECK(!root_);
// Make it so we get OnWillEmbed() for any Embed()s done by other apps we
@@ -123,39 +121,39 @@ void DesktopUI::OnEmbed(mojo::View* root) {
}
}
-void DesktopUI::OnViewManagerDestroyed(mojo::ViewManager* view_manager) {
+void BrowserWindow::OnViewManagerDestroyed(mojo::ViewManager* view_manager) {
root_ = nullptr;
- manager_->BrowserUIClosed(this);
+ manager_->BrowserWindowClosed(this);
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, mojo::ViewManagerRootClient implementation:
+// BrowserWindow, mojo::ViewManagerRootClient implementation:
-void DesktopUI::OnAccelerator(mojo::EventPtr event) {
+void BrowserWindow::OnAccelerator(mojo::EventPtr event) {
DCHECK_EQ(mojo::KEYBOARD_CODE_BROWSER_BACK,
event->key_data->windows_key_code);
NOTIMPLEMENTED();
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, web_view::mojom::WebViewClient implementation:
+// BrowserWindow, web_view::mojom::WebViewClient implementation:
-void DesktopUI::TopLevelNavigate(mojo::URLRequestPtr request) {
+void BrowserWindow::TopLevelNavigate(mojo::URLRequestPtr request) {
Embed(request.Pass());
}
-void DesktopUI::LoadingStateChanged(bool is_loading) {
+void BrowserWindow::LoadingStateChanged(bool is_loading) {
progress_bar_->SetIsLoading(is_loading);
}
-void DesktopUI::ProgressChanged(double progress) {
+void BrowserWindow::ProgressChanged(double progress) {
progress_bar_->SetProgress(progress);
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, ViewEmbedder implementation:
+// BrowserWindow, ViewEmbedder implementation:
-void DesktopUI::Embed(mojo::URLRequestPtr request) {
+void BrowserWindow::Embed(mojo::URLRequestPtr request) {
const std::string string_url = request->url.To<std::string>();
if (string_url == "mojo:omnibox") {
EmbedOmnibox(omnibox_connection_.get());
@@ -172,21 +170,21 @@ void DesktopUI::Embed(mojo::URLRequestPtr request) {
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, mojo::InterfaceFactory<ViewEmbedder> implementation:
+// BrowserWindow, mojo::InterfaceFactory<ViewEmbedder> implementation:
-void DesktopUI::Create(mojo::ApplicationConnection* connection,
- mojo::InterfaceRequest<ViewEmbedder> request) {
+void BrowserWindow::Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<ViewEmbedder> request) {
view_embedder_bindings_.AddBinding(this, request.Pass());
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, views::LayoutManager implementation:
+// BrowserWindow, views::LayoutManager implementation:
-gfx::Size DesktopUI::GetPreferredSize(const views::View* view) const {
+gfx::Size BrowserWindow::GetPreferredSize(const views::View* view) const {
return gfx::Size();
}
-void DesktopUI::Layout(views::View* host) {
+void BrowserWindow::Layout(views::View* host) {
gfx::Rect omnibox_launcher_bounds = host->bounds();
omnibox_launcher_bounds.Inset(10, 10, 10, host->bounds().height() - 40);
omnibox_launcher_->SetBoundsRect(omnibox_launcher_bounds);
@@ -209,17 +207,18 @@ void DesktopUI::Layout(views::View* host) {
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, views::ButtonListener implementation:
+// BrowserWindow, views::ButtonListener implementation:
-void DesktopUI::ButtonPressed(views::Button* sender, const ui::Event& event) {
+void BrowserWindow::ButtonPressed(views::Button* sender,
+ const ui::Event& event) {
DCHECK_EQ(sender, omnibox_launcher_);
ShowOmnibox();
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopUI, private:
+// BrowserWindow, private:
-void DesktopUI::Init(mojo::View* root) {
+void BrowserWindow::Init(mojo::View* root) {
DCHECK_GT(root->viewport_metrics().device_pixel_ratio, 0);
if (!aura_init_)
aura_init_.reset(new AuraInit(root, app_->shell()));
@@ -251,7 +250,7 @@ void DesktopUI::Init(mojo::View* root) {
root_->SetFocus();
}
-void DesktopUI::ShowOmnibox() {
+void BrowserWindow::ShowOmnibox() {
if (!omnibox_.get()) {
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = mojo::String::From("mojo:omnibox");
@@ -268,7 +267,7 @@ void DesktopUI::ShowOmnibox() {
omnibox_->ShowForURL(mojo::String::From(current_url_.spec()));
}
-void DesktopUI::EmbedOmnibox(mojo::ApplicationConnection* connection) {
+void BrowserWindow::EmbedOmnibox(mojo::ApplicationConnection* connection) {
mojo::ViewManagerClientPtr view_manager_client;
connection->ConnectToService(&view_manager_client);
omnibox_view_->Embed(view_manager_client.Pass());
@@ -280,13 +279,4 @@ void DesktopUI::EmbedOmnibox(mojo::ApplicationConnection* connection) {
omnibox_view_->MoveToFront();
}
-////////////////////////////////////////////////////////////////////////////////
-// BrowserUI, public:
-
-// static
-BrowserUI* BrowserUI::Create(mojo::ApplicationImpl* application_impl,
- BrowserManager* manager) {
- return new DesktopUI(application_impl, manager);
-}
-
} // namespace mandoline
diff --git a/mandoline/ui/browser/desktop/desktop_ui.h b/mandoline/ui/desktop_ui/browser_window.h
index f1c0ca6..6bcf484 100644
--- a/mandoline/ui/browser/desktop/desktop_ui.h
+++ b/mandoline/ui/desktop_ui/browser_window.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_
-#define MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_
+#ifndef MANDOLINE_UI_DESKTOP_UI_BROWSER_WINDOW_H_
+#define MANDOLINE_UI_DESKTOP_UI_BROWSER_WINDOW_H_
#include "components/view_manager/public/cpp/view_manager.h"
#include "components/view_manager/public/cpp/view_manager_delegate.h"
@@ -12,9 +12,8 @@
#include "mandoline/tab/public/cpp/web_view.h"
#include "mandoline/tab/public/interfaces/web_view.mojom.h"
#include "mandoline/ui/aura/aura_init.h"
-#include "mandoline/ui/browser/browser_ui.h"
-#include "mandoline/ui/browser/public/interfaces/omnibox.mojom.h"
-#include "mandoline/ui/browser/public/interfaces/view_embedder.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/view_embedder.mojom.h"
#include "mojo/application/public/cpp/interface_factory.h"
#include "mojo/common/weak_binding_set.h"
#include "ui/views/controls/button/button.h"
@@ -33,24 +32,23 @@ class LabelButton;
namespace mandoline {
+class BrowserManager;
class ProgressView;
-class DesktopUI : public BrowserUI,
- public mojo::ViewManagerDelegate,
- public mojo::ViewManagerRootClient,
- public web_view::mojom::WebViewClient,
- public ViewEmbedder,
- public mojo::InterfaceFactory<ViewEmbedder>,
- public views::LayoutManager,
- public views::ButtonListener {
+class BrowserWindow : public mojo::ViewManagerDelegate,
+ public mojo::ViewManagerRootClient,
+ public web_view::mojom::WebViewClient,
+ public ViewEmbedder,
+ public mojo::InterfaceFactory<ViewEmbedder>,
+ public views::LayoutManager,
+ public views::ButtonListener {
public:
- DesktopUI(mojo::ApplicationImpl* app, BrowserManager* manager);
- ~DesktopUI() override;
+ BrowserWindow(mojo::ApplicationImpl* app, BrowserManager* manager);
+ ~BrowserWindow() override;
- private:
- // Overridden from BrowserUI:
- void LoadURL(const GURL& url) override;
+ void LoadURL(const GURL& url);
+ private:
// Overridden from mojo::ViewManagerDelegate:
void OnEmbed(mojo::View* root) override;
void OnViewManagerDestroyed(mojo::ViewManager* view_manager) override;
@@ -102,9 +100,9 @@ class DesktopUI : public BrowserUI,
OmniboxPtr omnibox_;
scoped_ptr<mojo::ApplicationConnection> omnibox_connection_;
- DISALLOW_COPY_AND_ASSIGN(DesktopUI);
+ DISALLOW_COPY_AND_ASSIGN(BrowserWindow);
};
} // namespace mandoline
-#endif // MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_
+#endif // MANDOLINE_UI_DESKTOP_UI_BROWSER_WINDOW_H_
diff --git a/mandoline/ui/browser/main.cc b/mandoline/ui/desktop_ui/main.cc
index a7128af..65df601 100644
--- a/mandoline/ui/browser/main.cc
+++ b/mandoline/ui/desktop_ui/main.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mandoline/ui/browser/browser_manager.h"
+#include "mandoline/ui/desktop_ui/browser_manager.h"
#include "mojo/application/public/cpp/application_runner.h"
#include "third_party/mojo/src/mojo/public/c/system/main.h"
diff --git a/mandoline/ui/browser/public/interfaces/BUILD.gn b/mandoline/ui/desktop_ui/public/interfaces/BUILD.gn
index ffb04c1..ffb04c1 100644
--- a/mandoline/ui/browser/public/interfaces/BUILD.gn
+++ b/mandoline/ui/desktop_ui/public/interfaces/BUILD.gn
diff --git a/mandoline/ui/browser/public/interfaces/launch_handler.mojom b/mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom
index e402d1a..e402d1a 100644
--- a/mandoline/ui/browser/public/interfaces/launch_handler.mojom
+++ b/mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom
diff --git a/mandoline/ui/browser/public/interfaces/omnibox.mojom b/mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom
index 01a3069..01a3069 100644
--- a/mandoline/ui/browser/public/interfaces/omnibox.mojom
+++ b/mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom
diff --git a/mandoline/ui/browser/public/interfaces/view_embedder.mojom b/mandoline/ui/desktop_ui/public/interfaces/view_embedder.mojom
index 693dfee..693dfee 100644
--- a/mandoline/ui/browser/public/interfaces/view_embedder.mojom
+++ b/mandoline/ui/desktop_ui/public/interfaces/view_embedder.mojom
diff --git a/mandoline/ui/omnibox/BUILD.gn b/mandoline/ui/omnibox/BUILD.gn
index 6741c0b..db9cc02 100644
--- a/mandoline/ui/omnibox/BUILD.gn
+++ b/mandoline/ui/omnibox/BUILD.gn
@@ -28,7 +28,7 @@ source_set("lib") {
"//base",
"//components/view_manager/public/cpp",
"//mandoline/ui/aura",
- "//mandoline/ui/browser/public/interfaces",
+ "//mandoline/ui/desktop_ui/public/interfaces",
"//mojo/application/public/cpp:sources",
"//mojo/common",
"//mojo/converters/geometry",
diff --git a/mandoline/ui/omnibox/omnibox_impl.h b/mandoline/ui/omnibox/omnibox_impl.h
index 3f0514a..33c35bed 100644
--- a/mandoline/ui/omnibox/omnibox_impl.h
+++ b/mandoline/ui/omnibox/omnibox_impl.h
@@ -6,8 +6,8 @@
#define MANDOLINE_UI_OMNIBOX_OMNIBOX_IMPL_H_
#include "components/view_manager/public/cpp/view_manager_delegate.h"
-#include "mandoline/ui/browser/public/interfaces/omnibox.mojom.h"
-#include "mandoline/ui/browser/public/interfaces/view_embedder.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/view_embedder.mojom.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/application/public/cpp/interface_factory.h"
#include "mojo/common/weak_binding_set.h"
diff --git a/mandoline/ui/phone_ui/BUILD.gn b/mandoline/ui/phone_ui/BUILD.gn
index b9eb532..2b244e5 100644
--- a/mandoline/ui/phone_ui/BUILD.gn
+++ b/mandoline/ui/phone_ui/BUILD.gn
@@ -29,7 +29,7 @@ source_set("lib") {
"//components/view_manager/public/interfaces",
"//mandoline/tab/public/cpp",
"//mandoline/tab/public/interfaces",
- "//mandoline/ui/browser/public/interfaces",
+ "//mandoline/ui/desktop_ui/public/interfaces",
"//mojo/application/public/cpp",
"//mojo/common",
"//mojo/converters/geometry",
diff --git a/mandoline/ui/phone_ui/phone_browser_application_delegate.h b/mandoline/ui/phone_ui/phone_browser_application_delegate.h
index 2bd1da0..60018c6 100644
--- a/mandoline/ui/phone_ui/phone_browser_application_delegate.h
+++ b/mandoline/ui/phone_ui/phone_browser_application_delegate.h
@@ -12,7 +12,7 @@
#include "mandoline/tab/public/cpp/web_view.h"
#include "mandoline/tab/public/interfaces/web_view.mojom.h"
// TODO(beng): move this file somewhere common.
-#include "mandoline/ui/browser/public/interfaces/launch_handler.mojom.h"
+#include "mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/application/public/cpp/interface_factory.h"
#include "mojo/common/weak_binding_set.h"