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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 975293004: Start caching the theme color in web_contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 "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/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after
2762 2762
2763 if (delegate_) 2763 if (delegate_)
2764 return delegate_->CanOverscrollContent(); 2764 return delegate_->CanOverscrollContent();
2765 2765
2766 return false; 2766 return false;
2767 } 2767 }
2768 2768
2769 void WebContentsImpl::OnThemeColorChanged(SkColor theme_color) { 2769 void WebContentsImpl::OnThemeColorChanged(SkColor theme_color) {
2770 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2770 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2771 DidChangeThemeColor(theme_color)); 2771 DidChangeThemeColor(theme_color));
2772 RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
2773 if (rwhv)
2774 rwhv->SetThemeColor(theme_color);
no sievers 2015/03/04 23:00:46 Why don't you just cache it in here? Esp. since th
Yusuf 2015/03/04 23:26:29 Then wouldn't we have to refresh it explicitly whe
no sievers 2015/03/04 23:37:42 Wait, isn't the bug then that we don't get a notif
Yusuf 2015/03/04 23:38:56 We only get notified if there is a color, but don'
2772 } 2775 }
2773 2776
2774 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( 2777 void WebContentsImpl::OnDidLoadResourceFromMemoryCache(
2775 const GURL& url, 2778 const GURL& url,
2776 const std::string& security_info, 2779 const std::string& security_info,
2777 const std::string& http_method, 2780 const std::string& http_method,
2778 const std::string& mime_type, 2781 const std::string& mime_type,
2779 ResourceType resource_type) { 2782 ResourceType resource_type) {
2780 2783
2781 // Send out a notification that we loaded a resource from our memory cache. 2784 // Send out a notification that we loaded a resource from our memory cache.
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after
4535 node->render_manager()->ResumeResponseDeferredAtStart(); 4538 node->render_manager()->ResumeResponseDeferredAtStart();
4536 } 4539 }
4537 4540
4538 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4541 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4539 force_disable_overscroll_content_ = force_disable; 4542 force_disable_overscroll_content_ = force_disable;
4540 if (view_) 4543 if (view_)
4541 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4544 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4542 } 4545 }
4543 4546
4544 } // namespace content 4547 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698