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(FastResizeGravity gravity) { | |
108 wcv_holder_->set_fast_resize_gravity(gravity); | |
109 } | |
110 | |
111 | |
sky
2013/09/24 20:23:25
nit: only one newline.
rharrison
2013/09/26 20:36:48
Done.
| |
108 void WebView::OnWebContentsFocused(content::WebContents* web_contents) { | 112 void WebView::OnWebContentsFocused(content::WebContents* web_contents) { |
109 FocusManager* focus_manager = GetFocusManager(); | 113 FocusManager* focus_manager = GetFocusManager(); |
110 if (focus_manager) | 114 if (focus_manager) |
111 focus_manager->SetFocusedView(this); | 115 focus_manager->SetFocusedView(this); |
112 } | 116 } |
113 | 117 |
114 void WebView::SetPreferredSize(const gfx::Size& preferred_size) { | 118 void WebView::SetPreferredSize(const gfx::Size& preferred_size) { |
115 preferred_size_ = preferred_size; | 119 preferred_size_ = preferred_size; |
116 PreferredSizeChanged(); | 120 PreferredSizeChanged(); |
117 } | 121 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 if (!contents) { | 323 if (!contents) { |
320 content::WebContents::CreateParams create_params( | 324 content::WebContents::CreateParams create_params( |
321 browser_context, site_instance); | 325 browser_context, site_instance); |
322 return content::WebContents::Create(create_params); | 326 return content::WebContents::Create(create_params); |
323 } | 327 } |
324 | 328 |
325 return contents; | 329 return contents; |
326 } | 330 } |
327 | 331 |
328 } // namespace views | 332 } // namespace views |
OLD | NEW |