Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: ui/views/controls/webview/webview.cc

Issue 24299004: Implement features in NativeViewHostAura for scroll end effect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up unit tests and responded to other comments from sky@ Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (!contents) { 321 if (!contents) {
319 content::WebContents::CreateParams create_params( 322 content::WebContents::CreateParams create_params(
320 browser_context, site_instance); 323 browser_context, site_instance);
321 return content::WebContents::Create(create_params); 324 return content::WebContents::Create(create_params);
322 } 325 }
323 326
324 return contents; 327 return contents;
325 } 328 }
326 329
327 } // namespace views 330 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698