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

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

Issue 2905523004: Making answer card to behave like other results. (Closed)
Patch Set: Fixing build breakage. Created 3 years, 6 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
« no previous file with comments | « ui/views/controls/webview/web_contents_set_background_color.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/browser/chromeos/login/ui/web_contents_set_background_color.h" 5 #include "ui/views/controls/webview/web_contents_set_background_color.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/render_widget_host.h" 9 #include "content/public/browser/render_widget_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
11 11
12 DEFINE_WEB_CONTENTS_USER_DATA_KEY(chromeos::WebContentsSetBackgroundColor); 12 DEFINE_WEB_CONTENTS_USER_DATA_KEY(views::WebContentsSetBackgroundColor);
13 13
14 namespace chromeos { 14 namespace views {
15 15
16 // static 16 // static
17 void WebContentsSetBackgroundColor::CreateForWebContentsWithColor( 17 void WebContentsSetBackgroundColor::CreateForWebContentsWithColor(
18 content::WebContents* web_contents, 18 content::WebContents* web_contents,
19 SkColor color) { 19 SkColor color) {
20 if (FromWebContents(web_contents)) 20 if (FromWebContents(web_contents))
21 return; 21 return;
22 22
23 // SupportsUserData::Data takes ownership over the 23 // SupportsUserData::Data takes ownership over the
24 // WebContentsSetBackgroundColor instance and will destroy it when the 24 // WebContentsSetBackgroundColor instance and will destroy it when the
(...skipping 22 matching lines...) Expand all
47 content::RenderViewHost* render_view_host) { 47 content::RenderViewHost* render_view_host) {
48 render_view_host->GetWidget()->GetView()->SetBackgroundColor(color_); 48 render_view_host->GetWidget()->GetView()->SetBackgroundColor(color_);
49 } 49 }
50 50
51 void WebContentsSetBackgroundColor::RenderViewHostChanged( 51 void WebContentsSetBackgroundColor::RenderViewHostChanged(
52 content::RenderViewHost* old_host, 52 content::RenderViewHost* old_host,
53 content::RenderViewHost* new_host) { 53 content::RenderViewHost* new_host) {
54 new_host->GetWidget()->GetView()->SetBackgroundColor(color_); 54 new_host->GetWidget()->GetView()->SetBackgroundColor(color_);
55 } 55 }
56 56
57 } // namespace chromeos 57 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/webview/web_contents_set_background_color.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698