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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 return true; | 502 return true; |
503 render_view_message_source_ = render_view_host; | 503 render_view_message_source_ = render_view_host; |
504 } | 504 } |
505 | 505 |
506 bool handled = true; | 506 bool handled = true; |
507 IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message) | 507 IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message) |
508 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 508 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
509 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) | 509 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) |
510 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, | 510 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, |
511 OnDomOperationResponse) | 511 OnDomOperationResponse) |
| 512 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeBrandColor, |
| 513 OnBrandColorChanged) |
512 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, | 514 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, |
513 OnDocumentLoadedInFrame) | 515 OnDocumentLoadedInFrame) |
514 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad) | 516 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad) |
515 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) | 517 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) |
516 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) | 518 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) |
517 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, | 519 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, |
518 OnDidChangeLoadProgress) | 520 OnDidChangeLoadProgress) |
519 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenColorChooser, OnOpenColorChooser) | 521 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenColorChooser, OnOpenColorChooser) |
520 IPC_MESSAGE_HANDLER(FrameHostMsg_EndColorChooser, OnEndColorChooser) | 522 IPC_MESSAGE_HANDLER(FrameHostMsg_EndColorChooser, OnEndColorChooser) |
521 IPC_MESSAGE_HANDLER(FrameHostMsg_SetSelectedColorInColorChooser, | 523 IPC_MESSAGE_HANDLER(FrameHostMsg_SetSelectedColorInColorChooser, |
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 // Disable overscroll when touch emulation is on. See crbug.com/369938. | 2507 // Disable overscroll when touch emulation is on. See crbug.com/369938. |
2506 if (touch_emulation_enabled_) | 2508 if (touch_emulation_enabled_) |
2507 return false; | 2509 return false; |
2508 | 2510 |
2509 if (delegate_) | 2511 if (delegate_) |
2510 return delegate_->CanOverscrollContent(); | 2512 return delegate_->CanOverscrollContent(); |
2511 | 2513 |
2512 return false; | 2514 return false; |
2513 } | 2515 } |
2514 | 2516 |
| 2517 void WebContentsImpl::OnBrandColorChanged(SkColor brand_color) { |
| 2518 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2519 DidChangeBrandColor(brand_color)); |
| 2520 } |
| 2521 |
2515 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( | 2522 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( |
2516 const GURL& url, | 2523 const GURL& url, |
2517 const std::string& security_info, | 2524 const std::string& security_info, |
2518 const std::string& http_method, | 2525 const std::string& http_method, |
2519 const std::string& mime_type, | 2526 const std::string& mime_type, |
2520 ResourceType::Type resource_type) { | 2527 ResourceType::Type resource_type) { |
2521 base::StatsCounter cache("WebKit.CacheHit"); | 2528 base::StatsCounter cache("WebKit.CacheHit"); |
2522 cache.Increment(); | 2529 cache.Increment(); |
2523 | 2530 |
2524 // Send out a notification that we loaded a resource from our memory cache. | 2531 // 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... |
4072 | 4079 |
4073 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4080 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4074 if (!delegate_) | 4081 if (!delegate_) |
4075 return; | 4082 return; |
4076 const gfx::Size new_size = GetPreferredSize(); | 4083 const gfx::Size new_size = GetPreferredSize(); |
4077 if (new_size != old_size) | 4084 if (new_size != old_size) |
4078 delegate_->UpdatePreferredSize(this, new_size); | 4085 delegate_->UpdatePreferredSize(this, new_size); |
4079 } | 4086 } |
4080 | 4087 |
4081 } // namespace content | 4088 } // namespace content |
OLD | NEW |