Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1041)

Unified Diff: mandoline/ui/desktop_ui/browser_window.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mandoline/ui/desktop_ui/browser_window.h ('k') | mandoline/ui/omnibox/omnibox_application.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mandoline/ui/desktop_ui/browser_window.cc
diff --git a/mandoline/ui/desktop_ui/browser_window.cc b/mandoline/ui/desktop_ui/browser_window.cc
index eee1fe115844d70709bb9e9e08fac618b25dba3c..b87a604c4fbee17da8109e2ec02e14769ea5003d 100644
--- a/mandoline/ui/desktop_ui/browser_window.cc
+++ b/mandoline/ui/desktop_ui/browser_window.cc
@@ -26,6 +26,7 @@
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/services/tracing/public/cpp/switches.h"
#include "mojo/services/tracing/public/interfaces/tracing.mojom.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "ui/gfx/canvas.h"
#include "ui/mojo/init/ui_init.h"
#include "ui/views/background.h"
@@ -104,10 +105,10 @@ class BrowserWindow::LayoutManagerImpl : public views::LayoutManager {
////////////////////////////////////////////////////////////////////////////////
// BrowserWindow, public:
-BrowserWindow::BrowserWindow(mojo::ApplicationImpl* app,
+BrowserWindow::BrowserWindow(mojo::Shell* shell,
mus::mojom::WindowTreeHostFactory* host_factory,
BrowserManager* manager)
- : app_(app),
+ : shell_(shell),
window_manager_client_(nullptr),
manager_(manager),
toolbar_view_(nullptr),
@@ -150,7 +151,7 @@ void BrowserWindow::Close() {
void BrowserWindow::ShowOmnibox() {
TRACE_EVENT0("desktop_ui", "BrowserWindow::ShowOmnibox");
if (!omnibox_.get()) {
- omnibox_connection_ = app_->ConnectToApplication("mojo:omnibox");
+ omnibox_connection_ = shell_->ConnectToApplication("mojo:omnibox");
omnibox_connection_->AddService<ViewEmbedder>(this);
omnibox_connection_->ConnectToService(&omnibox_);
omnibox_connection_->SetRemoteServiceProviderConnectionErrorHandler(
@@ -212,7 +213,7 @@ void BrowserWindow::OnEmbed(mus::Window* root) {
window_manager_client_->AddActivationParent(root_);
content_->SetVisible(true);
- web_view_.Init(app_, content_);
+ web_view_.Init(shell_, content_);
const base::Callback<void(bool)> add_accelerator_callback =
base::Bind(&OnAcceleratorAdded);
@@ -261,7 +262,7 @@ void BrowserWindow::OnEmbed(mus::Window* root) {
base::CommandLine::ForCurrentProcess()->HasSwitch(
tracing::kEnableStatsCollectionBindings)) {
tracing::StartupPerformanceDataCollectorPtr collector;
- app_->ConnectToService("mojo:tracing", &collector);
+ shell_->ConnectToService("mojo:tracing", &collector);
collector->SetBrowserWindowDisplayTicks(display_ticks.ToInternalValue());
collector->SetBrowserOpenTabsTimeDelta(open_tabs_delta.ToInternalValue());
collector->SetBrowserMessageLoopStartTicks(
@@ -415,7 +416,7 @@ void BrowserWindow::Init(mus::Window* root) {
DCHECK_GT(root->viewport_metrics().device_pixel_ratio, 0);
if (!aura_init_) {
ui_init_.reset(new ui::mojo::UIInit(views::GetDisplaysFromWindow(root)));
- aura_init_.reset(new views::AuraInit(app_, "mandoline_ui.pak"));
+ aura_init_.reset(new views::AuraInit(shell_, "mandoline_ui.pak"));
}
root_ = root;
@@ -439,7 +440,7 @@ void BrowserWindow::Init(mus::Window* root) {
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
params.native_widget = new views::NativeWidgetMus(
- widget, app_->shell(), root, mus::mojom::SurfaceType::DEFAULT);
+ widget, shell_, root, mus::mojom::SurfaceType::DEFAULT);
params.delegate = widget_delegate;
params.bounds = root_->bounds();
widget->Init(params);
« no previous file with comments | « mandoline/ui/desktop_ui/browser_window.h ('k') | mandoline/ui/omnibox/omnibox_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698