| 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 return true; | 500 return true; |
| 501 render_view_message_source_ = render_view_host; | 501 render_view_message_source_ = render_view_host; |
| 502 } | 502 } |
| 503 | 503 |
| 504 bool handled = true; | 504 bool handled = true; |
| 505 IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message) | 505 IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message) |
| 506 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 506 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
| 507 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) | 507 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) |
| 508 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, | 508 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, |
| 509 OnDomOperationResponse) | 509 OnDomOperationResponse) |
| 510 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeBrandColor, |
| 511 OnBrandColorChanged) |
| 510 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, | 512 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, |
| 511 OnDocumentLoadedInFrame) | 513 OnDocumentLoadedInFrame) |
| 512 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad) | 514 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad) |
| 513 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) | 515 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) |
| 514 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) | 516 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) |
| 515 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, | 517 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, |
| 516 OnDidChangeLoadProgress) | 518 OnDidChangeLoadProgress) |
| 517 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenColorChooser, OnOpenColorChooser) | 519 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenColorChooser, OnOpenColorChooser) |
| 518 IPC_MESSAGE_HANDLER(FrameHostMsg_EndColorChooser, OnEndColorChooser) | 520 IPC_MESSAGE_HANDLER(FrameHostMsg_EndColorChooser, OnEndColorChooser) |
| 519 IPC_MESSAGE_HANDLER(FrameHostMsg_SetSelectedColorInColorChooser, | 521 IPC_MESSAGE_HANDLER(FrameHostMsg_SetSelectedColorInColorChooser, |
| (...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2499 // Disable overscroll when touch emulation is on. See crbug.com/369938. | 2501 // Disable overscroll when touch emulation is on. See crbug.com/369938. |
| 2500 if (touch_emulation_enabled_) | 2502 if (touch_emulation_enabled_) |
| 2501 return false; | 2503 return false; |
| 2502 | 2504 |
| 2503 if (delegate_) | 2505 if (delegate_) |
| 2504 return delegate_->CanOverscrollContent(); | 2506 return delegate_->CanOverscrollContent(); |
| 2505 | 2507 |
| 2506 return false; | 2508 return false; |
| 2507 } | 2509 } |
| 2508 | 2510 |
| 2511 void WebContentsImpl::OnBrandColorChanged(uint32 brand_color) { |
| 2512 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2513 DidChangeBrandColor(brand_color)); |
| 2514 } |
| 2515 |
| 2509 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( | 2516 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( |
| 2510 const GURL& url, | 2517 const GURL& url, |
| 2511 const std::string& security_info, | 2518 const std::string& security_info, |
| 2512 const std::string& http_method, | 2519 const std::string& http_method, |
| 2513 const std::string& mime_type, | 2520 const std::string& mime_type, |
| 2514 ResourceType::Type resource_type) { | 2521 ResourceType::Type resource_type) { |
| 2515 base::StatsCounter cache("WebKit.CacheHit"); | 2522 base::StatsCounter cache("WebKit.CacheHit"); |
| 2516 cache.Increment(); | 2523 cache.Increment(); |
| 2517 | 2524 |
| 2518 // Send out a notification that we loaded a resource from our memory cache. | 2525 // Send out a notification that we loaded a resource from our memory cache. |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4066 | 4073 |
| 4067 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4074 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
| 4068 if (!delegate_) | 4075 if (!delegate_) |
| 4069 return; | 4076 return; |
| 4070 const gfx::Size new_size = GetPreferredSize(); | 4077 const gfx::Size new_size = GetPreferredSize(); |
| 4071 if (new_size != old_size) | 4078 if (new_size != old_size) |
| 4072 delegate_->UpdatePreferredSize(this, new_size); | 4079 delegate_->UpdatePreferredSize(this, new_size); |
| 4073 } | 4080 } |
| 4074 | 4081 |
| 4075 } // namespace content | 4082 } // namespace content |
| OLD | NEW |