OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/webview/webview.h" | 5 #include "ui/views/controls/webview/webview.h" |
6 | 6 |
7 #include "content/public/browser/browser_accessibility_state.h" | 7 #include "content/public/browser/browser_accessibility_state.h" |
8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
9 #include "content/public/browser/navigation_controller.h" | 9 #include "content/public/browser/navigation_controller.h" |
10 #include "content/public/browser/notification_details.h" | 10 #include "content/public/browser/notification_details.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // The view will not be focused automatically when it is attached, so we need | 255 // The view will not be focused automatically when it is attached, so we need |
256 // to pass on focus to it if the FocusManager thinks the view is focused. Note | 256 // to pass on focus to it if the FocusManager thinks the view is focused. Note |
257 // that not every Widget has a focus manager. | 257 // that not every Widget has a focus manager. |
258 FocusManager* const focus_manager = GetFocusManager(); | 258 FocusManager* const focus_manager = GetFocusManager(); |
259 if (focus_manager && focus_manager->GetFocusedView() == this) | 259 if (focus_manager && focus_manager->GetFocusedView() == this) |
260 OnFocus(); | 260 OnFocus(); |
261 | 261 |
262 registrar_.Add( | 262 registrar_.Add( |
263 this, | 263 this, |
264 content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, | 264 content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |
265 content::Source<content::NavigationController>( | 265 content::Source<content::WebContents>(web_contents_)); |
266 &web_contents_->GetController())); | |
267 registrar_.Add( | 266 registrar_.Add( |
268 this, | 267 this, |
269 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 268 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
270 content::Source<content::WebContents>(web_contents_)); | 269 content::Source<content::WebContents>(web_contents_)); |
271 | 270 |
272 #if defined(OS_WIN) && defined(USE_AURA) | 271 #if defined(OS_WIN) && defined(USE_AURA) |
273 if (!is_embedding_fullscreen_widget_) { | 272 if (!is_embedding_fullscreen_widget_) { |
274 web_contents_->SetParentNativeViewAccessible( | 273 web_contents_->SetParentNativeViewAccessible( |
275 parent()->GetNativeViewAccessible()); | 274 parent()->GetNativeViewAccessible()); |
276 } | 275 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 if (!contents) { | 318 if (!contents) { |
320 content::WebContents::CreateParams create_params( | 319 content::WebContents::CreateParams create_params( |
321 browser_context, site_instance); | 320 browser_context, site_instance); |
322 return content::WebContents::Create(create_params); | 321 return content::WebContents::Create(create_params); |
323 } | 322 } |
324 | 323 |
325 return contents; | 324 return contents; |
326 } | 325 } |
327 | 326 |
328 } // namespace views | 327 } // namespace views |
OLD | NEW |