1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/first_run/first_run_view.h"
7 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h"
8 #include "chrome/common/url_constants.h"
9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_widget_host_view.h"
11 #include "content/public/browser/web_contents.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "ui/views/controls/webview/webview.h"
18 FirstRunView::FirstRunView()
22 void FirstRunView::Init(content::BrowserContext* context) {
23 web_view_ = new views::WebView(context);
24 AddChildView(web_view_);
25 web_view_->LoadInitialURL(GURL(chrome::kChromeUIFirstRunURL));
26 web_view_->RequestFocus();
28 web_view_->web_contents()->SetDelegate(this);
31 background.setConfig(SkBitmap::kA8_Config, 1, 1);
32 background.allocPixels();
33 background.eraseARGB(0, 0, 0, 0);
34 web_view_->web_contents()->GetRenderViewHost()->GetView()->
35 SetBackground(background);
38 FirstRunActor* FirstRunView::GetActor() {
39 return static_cast<FirstRunUI*>(
40 web_view_->web_contents()->GetWebUI()->GetController())->get_actor();
43 void FirstRunView::Layout() {
44 web_view_->SetBoundsRect(bounds());
47 bool FirstRunView::HandleContextMenu(
48 const content::ContextMenuParams& params) {
49 // Discards context menu.
53 } // namespace chromeos