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

Side by Side Diff: services/navigation/view_impl.cc

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: fix navigation Created 4 years, 3 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
« no previous file with comments | « services/navigation/view_impl.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/navigation/view_impl.h" 5 #include "services/navigation/view_impl.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
8 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/interstitial_page.h" 10 #include "content/public/browser/interstitial_page.h"
10 #include "content/public/browser/interstitial_page_delegate.h" 11 #include "content/public/browser/interstitial_page_delegate.h"
11 #include "content/public/browser/navigation_controller.h" 12 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/browser/navigation_details.h" 13 #include "content/public/browser/navigation_details.h"
13 #include "content/public/browser/navigation_entry.h" 14 #include "content/public/browser/navigation_entry.h"
14 #include "content/public/browser/notification_details.h" 15 #include "content/public/browser/notification_details.h"
15 #include "content/public/browser/notification_source.h" 16 #include "content/public/browser/notification_source.h"
16 #include "content/public/browser/notification_types.h" 17 #include "content/public/browser/notification_types.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 web_view_->GetWebContents()->GetController().Reload(true); 106 web_view_->GetWebContents()->GetController().Reload(true);
106 else 107 else
107 web_view_->GetWebContents()->GetController().ReloadBypassingCache(true); 108 web_view_->GetWebContents()->GetController().ReloadBypassingCache(true);
108 } 109 }
109 110
110 void ViewImpl::Stop() { 111 void ViewImpl::Stop() {
111 web_view_->GetWebContents()->Stop(); 112 web_view_->GetWebContents()->Stop();
112 } 113 }
113 114
114 void ViewImpl::GetWindowTreeClient(ui::mojom::WindowTreeClientRequest request) { 115 void ViewImpl::GetWindowTreeClient(ui::mojom::WindowTreeClientRequest request) {
115 new ui::WindowTreeClient(this, nullptr, std::move(request)); 116 window_tree_client_ =
117 base::MakeUnique<ui::WindowTreeClient>(this, nullptr, std::move(request));
116 } 118 }
117 119
118 void ViewImpl::ShowInterstitial(const mojo::String& html) { 120 void ViewImpl::ShowInterstitial(const mojo::String& html) {
119 content::InterstitialPage* interstitial = 121 content::InterstitialPage* interstitial =
120 content::InterstitialPage::Create(web_view_->GetWebContents(), 122 content::InterstitialPage::Create(web_view_->GetWebContents(),
121 false, 123 false,
122 GURL(), 124 GURL(),
123 new InterstitialPageDelegate(html)); 125 new InterstitialPageDelegate(html));
124 interstitial->Show(); 126 interstitial->Show();
125 } 127 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 views::Widget::InitParams params( 275 views::Widget::InitParams params(
274 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 276 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
275 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 277 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
276 params.delegate = this; 278 params.delegate = this;
277 params.native_widget = new views::NativeWidgetMus( 279 params.native_widget = new views::NativeWidgetMus(
278 widget_.get(), root, ui::mojom::SurfaceType::DEFAULT); 280 widget_.get(), root, ui::mojom::SurfaceType::DEFAULT);
279 widget_->Init(params); 281 widget_->Init(params);
280 widget_->Show(); 282 widget_->Show();
281 } 283 }
282 284
283 void ViewImpl::OnDidDestroyClient(ui::WindowTreeClient* client) {} 285 void ViewImpl::OnEmbedRootDestroyed(ui::Window* root) {
286 window_tree_client_.reset();
287 }
288
289 void ViewImpl::OnLostConnection(ui::WindowTreeClient* client) {
290 window_tree_client_.reset();
291 }
292
284 void ViewImpl::OnPointerEventObserved(const ui::PointerEvent& event, 293 void ViewImpl::OnPointerEventObserved(const ui::PointerEvent& event,
285 ui::Window* target) {} 294 ui::Window* target) {}
286 295
287 views::View* ViewImpl::GetContentsView() { 296 views::View* ViewImpl::GetContentsView() {
288 return web_view_; 297 return web_view_;
289 } 298 }
290 299
291 views::Widget* ViewImpl::GetWidget() { 300 views::Widget* ViewImpl::GetWidget() {
292 return web_view_->GetWidget(); 301 return web_view_->GetWidget();
293 } 302 }
294 303
295 const views::Widget* ViewImpl::GetWidget() const { 304 const views::Widget* ViewImpl::GetWidget() const {
296 return web_view_->GetWidget(); 305 return web_view_->GetWidget();
297 } 306 }
298 307
299 } // navigation 308 } // navigation
OLDNEW
« no previous file with comments | « services/navigation/view_impl.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698