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

Side by Side Diff: chrome/browser/chromeos/set_time_dialog.cc

Issue 247663003: Date and Time dialog for when the clock isn't synced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, single quotes in browsertest js Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "chrome/browser/chromeos/set_time_dialog.h"
6
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 "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/gfx/size.h"
14
15 using content::WebContents;
16 using content::WebUIMessageHandler;
17
18 namespace chromeos {
19
20 namespace {
21
22 const int kDefaultWidth = 490;
23 const int kDefaultHeight = 235;
24
25 } // namespace
26
27 // static
28 void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window) {
29 content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show"));
30 chrome::ShowWebDialog(owning_window,
31 ProfileManager::GetActiveUserProfile(),
32 new SetTimeDialog());
33 }
34
35 SetTimeDialog::SetTimeDialog() {
36 }
37
38 SetTimeDialog::~SetTimeDialog() {
39 }
40
41 ui::ModalType SetTimeDialog::GetDialogModalType() const {
42 return ui::MODAL_TYPE_SYSTEM;
43 }
44
45 base::string16 SetTimeDialog::GetDialogTitle() const {
46 return base::string16();
47 }
48
49 GURL SetTimeDialog::GetDialogContentURL() const {
50 return GURL(chrome::kChromeUISetTimeURL);
51 }
52
53 void SetTimeDialog::GetWebUIMessageHandlers(
54 std::vector<WebUIMessageHandler*>* handlers) const {
55 }
56
57 void SetTimeDialog::GetDialogSize(gfx::Size* size) const {
58 size->SetSize(kDefaultWidth, kDefaultHeight);
59 }
60
61 std::string SetTimeDialog::GetDialogArgs() const {
62 return std::string();
63 }
64
65 void SetTimeDialog::OnDialogClosed(const std::string& json_retval) {
66 delete this;
67 }
68
69 void SetTimeDialog::OnCloseContents(WebContents* source,
70 bool* out_close_dialog) {
71 if (out_close_dialog)
72 *out_close_dialog = true;
73 }
74
75 bool SetTimeDialog::ShouldShowDialogTitle() const {
76 return false;
77 }
78
79 bool SetTimeDialog::HandleContextMenu(
80 const content::ContextMenuParams& params) {
81 // Disable context menu.
82 return true;
83 }
84
85 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/set_time_dialog.h ('k') | chrome/browser/resources/chromeos/set_time.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698