Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / chromeos / set_time_dialog.cc
blobd561f348cba05aa14de9be609cf4dffe634c0ce3
1 // Copyright 2014 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/set_time_dialog.h"
7 #include "chrome/browser/profiles/profile_manager.h"
8 #include "chrome/browser/ui/browser_dialogs.h"
9 #include "chrome/common/url_constants.h"
10 #include "content/public/browser/user_metrics.h"
11 #include "ui/gfx/geometry/size.h"
13 using content::WebContents;
14 using content::WebUIMessageHandler;
16 namespace chromeos {
18 namespace {
20 const int kDefaultWidth = 490;
21 const int kDefaultHeight = 235;
23 } // namespace
25 // static
26 void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window) {
27 content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show"));
28 chrome::ShowWebDialog(owning_window,
29 ProfileManager::GetActiveUserProfile(),
30 new SetTimeDialog());
33 SetTimeDialog::SetTimeDialog() {
36 SetTimeDialog::~SetTimeDialog() {
39 ui::ModalType SetTimeDialog::GetDialogModalType() const {
40 return ui::MODAL_TYPE_SYSTEM;
43 base::string16 SetTimeDialog::GetDialogTitle() const {
44 return base::string16();
47 GURL SetTimeDialog::GetDialogContentURL() const {
48 return GURL(chrome::kChromeUISetTimeURL);
51 void SetTimeDialog::GetWebUIMessageHandlers(
52 std::vector<WebUIMessageHandler*>* handlers) const {
55 void SetTimeDialog::GetDialogSize(gfx::Size* size) const {
56 size->SetSize(kDefaultWidth, kDefaultHeight);
59 std::string SetTimeDialog::GetDialogArgs() const {
60 return std::string();
63 void SetTimeDialog::OnDialogClosed(const std::string& json_retval) {
64 delete this;
67 void SetTimeDialog::OnCloseContents(WebContents* source,
68 bool* out_close_dialog) {
69 if (out_close_dialog)
70 *out_close_dialog = true;
73 bool SetTimeDialog::ShouldShowDialogTitle() const {
74 return false;
77 bool SetTimeDialog::HandleContextMenu(
78 const content::ContextMenuParams& params) {
79 // Disable context menu.
80 return true;
83 } // namespace chromeos