OLD | NEW |
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 Loading... |
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 |
OLD | NEW |