OLD | NEW |
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 "blimp/engine/browser/blimp_engine_session.h" | 5 #include "blimp/engine/browser/blimp_engine_session.h" |
6 | 6 |
7 #include "blimp/common/proto/blimp_message.pb.h" | 7 #include "blimp/common/proto/blimp_message.pb.h" |
8 #include "blimp/common/proto/control.pb.h" | 8 #include "blimp/common/proto/control.pb.h" |
9 #include "blimp/engine/browser/blimp_browser_context.h" | 9 #include "blimp/engine/browser/blimp_browser_context.h" |
10 #include "blimp/engine/ui/blimp_layout_manager.h" | 10 #include "blimp/engine/ui/blimp_layout_manager.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 return source; | 218 return source; |
219 } | 219 } |
220 | 220 |
221 void BlimpEngineSession::RequestToLockMouse(content::WebContents* web_contents, | 221 void BlimpEngineSession::RequestToLockMouse(content::WebContents* web_contents, |
222 bool user_gesture, | 222 bool user_gesture, |
223 bool last_unlocked_by_target) { | 223 bool last_unlocked_by_target) { |
224 web_contents->GotResponseToLockMouseRequest(true); | 224 web_contents->GotResponseToLockMouseRequest(true); |
225 } | 225 } |
226 | 226 |
227 void BlimpEngineSession::CloseContents(content::WebContents* source) { | 227 void BlimpEngineSession::CloseContents(content::WebContents* source) { |
228 if (source == web_contents_) | 228 if (source == web_contents_.get()) |
229 web_contents_.reset(); | 229 web_contents_.reset(); |
230 } | 230 } |
231 | 231 |
232 void BlimpEngineSession::ActivateContents(content::WebContents* contents) { | 232 void BlimpEngineSession::ActivateContents(content::WebContents* contents) { |
233 contents->GetRenderViewHost()->GetWidget()->Focus(); | 233 contents->GetRenderViewHost()->GetWidget()->Focus(); |
234 } | 234 } |
235 | 235 |
236 void BlimpEngineSession::PlatformSetContents( | 236 void BlimpEngineSession::PlatformSetContents( |
237 scoped_ptr<content::WebContents> new_contents) { | 237 scoped_ptr<content::WebContents> new_contents) { |
238 new_contents->SetDelegate(this); | 238 new_contents->SetDelegate(this); |
239 web_contents_ = new_contents.Pass(); | 239 web_contents_ = new_contents.Pass(); |
240 | 240 |
241 aura::Window* parent = window_tree_host_->window(); | 241 aura::Window* parent = window_tree_host_->window(); |
242 aura::Window* content = web_contents_->GetNativeView(); | 242 aura::Window* content = web_contents_->GetNativeView(); |
243 if (!parent->Contains(content)) | 243 if (!parent->Contains(content)) |
244 parent->AddChild(content); | 244 parent->AddChild(content); |
245 content->Show(); | 245 content->Show(); |
246 } | 246 } |
247 | 247 |
248 } // namespace engine | 248 } // namespace engine |
249 } // namespace blimp | 249 } // namespace blimp |
OLD | NEW |