summaryrefslogtreecommitdiffstats
path: root/ui/views_content_client/views_content_client.cc
blob: a1dcb4eb8850dc1af7a69e7cd9b89f4c25fa1dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views_content_client/views_content_client.h"

#include "build/build_config.h"
#include "content/public/app/content_main.h"
#include "ui/views_content_client/views_content_main_delegate.h"

namespace ui {

#if defined(OS_WIN)
ViewsContentClient::ViewsContentClient(
    HINSTANCE instance, sandbox::SandboxInterfaceInfo* sandbox_info)
    : instance_(instance), sandbox_info_(sandbox_info) {
}
#else
ViewsContentClient::ViewsContentClient(int argc, const char** argv)
    : argc_(argc), argv_(argv) {
}
#endif

ViewsContentClient::~ViewsContentClient() {
}

int ViewsContentClient::RunMain() {
  ViewsContentMainDelegate delegate(this);
  content::ContentMainParams params(&delegate);

#if defined(OS_WIN)
  params.instance = instance_;
  params.sandbox_info = sandbox_info_;
#else
  params.argc = argc_;
  params.argv = argv_;
#endif

  return content::ContentMain(params);
}

}  // namespace ui