| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 return source; | 168 return source; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void BlimpEngineSession::RequestToLockMouse(content::WebContents* web_contents, | 171 void BlimpEngineSession::RequestToLockMouse(content::WebContents* web_contents, |
| 172 bool user_gesture, | 172 bool user_gesture, |
| 173 bool last_unlocked_by_target) { | 173 bool last_unlocked_by_target) { |
| 174 web_contents->GotResponseToLockMouseRequest(true); | 174 web_contents->GotResponseToLockMouseRequest(true); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void BlimpEngineSession::CloseContents(content::WebContents* source) { | 177 void BlimpEngineSession::CloseContents(content::WebContents* source) { |
| 178 if (source == web_contents_) | 178 if (source == web_contents_.get()) |
| 179 web_contents_.reset(); | 179 web_contents_.reset(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void BlimpEngineSession::ActivateContents(content::WebContents* contents) { | 182 void BlimpEngineSession::ActivateContents(content::WebContents* contents) { |
| 183 contents->GetRenderViewHost()->GetWidget()->Focus(); | 183 contents->GetRenderViewHost()->GetWidget()->Focus(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void BlimpEngineSession::PlatformSetContents( | 186 void BlimpEngineSession::PlatformSetContents( |
| 187 scoped_ptr<content::WebContents> new_contents) { | 187 scoped_ptr<content::WebContents> new_contents) { |
| 188 new_contents->SetDelegate(this); | 188 new_contents->SetDelegate(this); |
| 189 web_contents_ = new_contents.Pass(); | 189 web_contents_ = new_contents.Pass(); |
| 190 | 190 |
| 191 aura::Window* parent = window_tree_host_->window(); | 191 aura::Window* parent = window_tree_host_->window(); |
| 192 aura::Window* content = web_contents_->GetNativeView(); | 192 aura::Window* content = web_contents_->GetNativeView(); |
| 193 if (!parent->Contains(content)) | 193 if (!parent->Contains(content)) |
| 194 parent->AddChild(content); | 194 parent->AddChild(content); |
| 195 content->Show(); | 195 content->Show(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace engine | 198 } // namespace engine |
| 199 } // namespace blimp | 199 } // namespace blimp |
| OLD | NEW |