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

Side by Side Diff: mandoline/ui/desktop_ui/browser_window.cc

Issue 1406153004: components/mus/public/interfaces View => Window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yet another rebase Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mandoline/ui/desktop_ui/browser_window.h" 5 #include "mandoline/ui/desktop_ui/browser_window.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 double progress_; 61 double progress_;
62 bool loading_; 62 bool loading_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(ProgressView); 64 DISALLOW_COPY_AND_ASSIGN(ProgressView);
65 }; 65 };
66 66
67 //////////////////////////////////////////////////////////////////////////////// 67 ////////////////////////////////////////////////////////////////////////////////
68 // BrowserWindow, public: 68 // BrowserWindow, public:
69 69
70 BrowserWindow::BrowserWindow(mojo::ApplicationImpl* app, 70 BrowserWindow::BrowserWindow(mojo::ApplicationImpl* app,
71 mojo::ViewTreeHostFactory* host_factory, 71 mus::mojom::WindowTreeHostFactory* host_factory,
72 BrowserManager* manager) 72 BrowserManager* manager)
73 : app_(app), 73 : app_(app),
74 host_client_binding_(this), 74 host_client_binding_(this),
75 manager_(manager), 75 manager_(manager),
76 toolbar_view_(nullptr), 76 toolbar_view_(nullptr),
77 progress_bar_(nullptr), 77 progress_bar_(nullptr),
78 find_bar_view_(nullptr), 78 find_bar_view_(nullptr),
79 root_(nullptr), 79 root_(nullptr),
80 content_(nullptr), 80 content_(nullptr),
81 omnibox_view_(nullptr), 81 omnibox_view_(nullptr),
82 find_active_(0), 82 find_active_(0),
83 find_count_(0), 83 find_count_(0),
84 web_view_(this) { 84 web_view_(this) {
85 mojo::ViewTreeHostClientPtr host_client; 85 mus::mojom::WindowTreeHostClientPtr host_client;
86 host_client_binding_.Bind(GetProxy(&host_client)); 86 host_client_binding_.Bind(GetProxy(&host_client));
87 mus::CreateWindowTreeHost(host_factory, host_client.Pass(), this, &host_); 87 mus::CreateWindowTreeHost(host_factory, host_client.Pass(), this, &host_);
88 } 88 }
89 89
90 void BrowserWindow::LoadURL(const GURL& url) { 90 void BrowserWindow::LoadURL(const GURL& url) {
91 // Haven't been embedded yet, can't embed. 91 // Haven't been embedded yet, can't embed.
92 // TODO(beng): remove this. 92 // TODO(beng): remove this.
93 if (!root_) { 93 if (!root_) {
94 default_url_ = url; 94 default_url_ = url;
95 return; 95 return;
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 params.native_widget = 396 params.native_widget =
397 new views::NativeWidgetViewManager(widget, app_->shell(), root_); 397 new views::NativeWidgetViewManager(widget, app_->shell(), root_);
398 params.delegate = widget_delegate; 398 params.delegate = widget_delegate;
399 params.bounds = root_->bounds().To<gfx::Rect>(); 399 params.bounds = root_->bounds().To<gfx::Rect>();
400 widget->Init(params); 400 widget->Init(params);
401 widget->Show(); 401 widget->Show();
402 root_->SetFocus(); 402 root_->SetFocus();
403 } 403 }
404 404
405 void BrowserWindow::EmbedOmnibox() { 405 void BrowserWindow::EmbedOmnibox() {
406 mojo::ViewTreeClientPtr view_tree_client; 406 mus::mojom::WindowTreeClientPtr view_tree_client;
407 omnibox_->GetViewTreeClient(GetProxy(&view_tree_client)); 407 omnibox_->GetWindowTreeClient(GetProxy(&view_tree_client));
408 omnibox_view_->Embed(view_tree_client.Pass()); 408 omnibox_view_->Embed(view_tree_client.Pass());
409 409
410 // TODO(beng): This should be handled sufficiently by 410 // TODO(beng): This should be handled sufficiently by
411 // OmniboxImpl::ShowWindow() but unfortunately view manager policy 411 // OmniboxImpl::ShowWindow() but unfortunately view manager policy
412 // currently prevents the embedded app from changing window z for 412 // currently prevents the embedded app from changing window z for
413 // its own window. 413 // its own window.
414 omnibox_view_->MoveToFront(); 414 omnibox_view_->MoveToFront();
415 } 415 }
416 416
417 } // namespace mandoline 417 } // namespace mandoline
OLDNEW
« no previous file with comments | « mandoline/ui/desktop_ui/browser_window.h ('k') | mandoline/ui/desktop_ui/public/interfaces/omnibox.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698