| 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" |
| 11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
| 12 #include "content/public/browser/notification_source.h" | 12 #include "content/public/browser/notification_source.h" |
| 13 #include "content/public/browser/notification_types.h" | 13 #include "content/public/browser/notification_types.h" |
| 14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
| 15 #include "content/public/browser/render_widget_host_view.h" | 15 #include "content/public/browser/render_widget_host_view.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "content/public/browser/web_contents_view.h" | 17 #include "content/public/browser/web_contents_view.h" |
| 18 #include "ipc/ipc_message.h" | 18 #include "ipc/ipc_message.h" |
| 19 #include "ui/base/accessibility/accessibility_types.h" | 19 #include "ui/base/accessibility/accessibility_types.h" |
| 20 #include "ui/base/accessibility/accessible_view_state.h" | 20 #include "ui/base/accessibility/accessible_view_state.h" |
| 21 #include "ui/events/event.h" | 21 #include "ui/events/event.h" |
| 22 #include "ui/views/accessibility/native_view_accessibility.h" | 22 #include "ui/views/accessibility/native_view_accessibility.h" |
| 23 #include "ui/views/controls/native/native_view_host.h" | |
| 24 #include "ui/views/focus/focus_manager.h" | 23 #include "ui/views/focus/focus_manager.h" |
| 25 #include "ui/views/views_delegate.h" | 24 #include "ui/views/views_delegate.h" |
| 26 | 25 |
| 27 namespace views { | 26 namespace views { |
| 28 | 27 |
| 29 // static | 28 // static |
| 30 const char WebView::kViewClassName[] = "WebView"; | 29 const char WebView::kViewClassName[] = "WebView"; |
| 31 | 30 |
| 32 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
| 33 // WebView, public: | 32 // WebView, public: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void WebView::LoadInitialURL(const GURL& url) { | 97 void WebView::LoadInitialURL(const GURL& url) { |
| 99 GetWebContents()->GetController().LoadURL( | 98 GetWebContents()->GetController().LoadURL( |
| 100 url, content::Referrer(), content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 99 url, content::Referrer(), content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 101 std::string()); | 100 std::string()); |
| 102 } | 101 } |
| 103 | 102 |
| 104 void WebView::SetFastResize(bool fast_resize) { | 103 void WebView::SetFastResize(bool fast_resize) { |
| 105 wcv_holder_->set_fast_resize(fast_resize); | 104 wcv_holder_->set_fast_resize(fast_resize); |
| 106 } | 105 } |
| 107 | 106 |
| 107 void WebView::SetFastResizeGravity(NativeViewHost::Gravity gravity) { |
| 108 wcv_holder_->set_fast_resize_gravity(gravity); |
| 109 } |
| 110 |
| 108 void WebView::OnWebContentsFocused(content::WebContents* web_contents) { | 111 void WebView::OnWebContentsFocused(content::WebContents* web_contents) { |
| 109 FocusManager* focus_manager = GetFocusManager(); | 112 FocusManager* focus_manager = GetFocusManager(); |
| 110 if (focus_manager) | 113 if (focus_manager) |
| 111 focus_manager->SetFocusedView(this); | 114 focus_manager->SetFocusedView(this); |
| 112 } | 115 } |
| 113 | 116 |
| 114 void WebView::SetPreferredSize(const gfx::Size& preferred_size) { | 117 void WebView::SetPreferredSize(const gfx::Size& preferred_size) { |
| 115 preferred_size_ = preferred_size; | 118 preferred_size_ = preferred_size; |
| 116 PreferredSizeChanged(); | 119 PreferredSizeChanged(); |
| 117 } | 120 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 if (!contents) { | 322 if (!contents) { |
| 320 content::WebContents::CreateParams create_params( | 323 content::WebContents::CreateParams create_params( |
| 321 browser_context, site_instance); | 324 browser_context, site_instance); |
| 322 return content::WebContents::Create(create_params); | 325 return content::WebContents::Create(create_params); |
| 323 } | 326 } |
| 324 | 327 |
| 325 return contents; | 328 return contents; |
| 326 } | 329 } |
| 327 | 330 |
| 328 } // namespace views | 331 } // namespace views |
| OLD | NEW |