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_context.h" | 7 #include "content/public/browser/browser_context.h" |
8 #include "content/public/browser/notification_details.h" | 8 #include "content/public/browser/notification_details.h" |
9 #include "content/public/browser/notification_registrar.h" | 9 #include "content/public/browser/notification_registrar.h" |
10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 wc_owner_.reset(); | 53 wc_owner_.reset(); |
54 web_contents_ = web_contents; | 54 web_contents_ = web_contents; |
55 AttachWebContents(); | 55 AttachWebContents(); |
56 } | 56 } |
57 | 57 |
58 void WebView::SetFastResize(bool fast_resize) { | 58 void WebView::SetFastResize(bool fast_resize) { |
59 wcv_holder_->set_fast_resize(fast_resize); | 59 wcv_holder_->set_fast_resize(fast_resize); |
60 } | 60 } |
61 | 61 |
62 void WebView::OnWebContentsFocused(content::WebContents* web_contents) { | 62 void WebView::OnWebContentsFocused(content::WebContents* web_contents) { |
| 63 DCHECK(web_contents == web_contents_); |
63 FocusManager* focus_manager = GetFocusManager(); | 64 FocusManager* focus_manager = GetFocusManager(); |
64 if (focus_manager) | 65 if (focus_manager) |
65 focus_manager->SetFocusedView(this); | 66 focus_manager->SetFocusedView(this); |
66 } | 67 } |
67 | 68 |
68 //////////////////////////////////////////////////////////////////////////////// | 69 //////////////////////////////////////////////////////////////////////////////// |
69 // WebView, View overrides: | 70 // WebView, View overrides: |
70 | 71 |
71 void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 72 void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
72 wcv_holder_->SetSize(bounds().size()); | 73 wcv_holder_->SetSize(bounds().size()); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (GetFocusManager()->GetFocusedView() == this) | 192 if (GetFocusManager()->GetFocusedView() == this) |
192 web_contents_->Focus(); | 193 web_contents_->Focus(); |
193 } | 194 } |
194 | 195 |
195 void WebView::WebContentsDestroyed(content::WebContents* web_contents) { | 196 void WebView::WebContentsDestroyed(content::WebContents* web_contents) { |
196 DCHECK(web_contents == web_contents_); | 197 DCHECK(web_contents == web_contents_); |
197 SetWebContents(NULL); | 198 SetWebContents(NULL); |
198 } | 199 } |
199 | 200 |
200 } // namespace views | 201 } // namespace views |
OLD | NEW |