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

Unified Diff: chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc

Issue 8271025: Moved mobile activation into its own modal dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
===================================================================
--- chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc (revision 0)
+++ chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc (revision 0)
@@ -0,0 +1,81 @@
+// Copyright (c) 2011 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 "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
+
+#include "base/bind.h"
+#include "base/memory/singleton.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/platform_util.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/webui/html_dialog_ui.h"
+#include "chrome/common/url_constants.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+// static
+MobileSetupDialog* MobileSetupDialog::GetInstance() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return Singleton<MobileSetupDialog>::get();
+}
+
+MobileSetupDialog::MobileSetupDialog() {
+}
+
+MobileSetupDialog::~MobileSetupDialog() {
+}
+
+// static
+void MobileSetupDialog::Show() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ MobileSetupDialog* dialog = MobileSetupDialog::GetInstance();
+ dialog->ShowDialog();
+}
+
+void MobileSetupDialog::ShowDialog() {
+ Browser* browser = BrowserList::GetLastActive();
+ browser->BrowserShowHtmlDialog(this, NULL);
xiyuan 2011/10/15 15:56:19 browser could be NULL.
zel 2011/10/18 22:22:16 Done.
+}
+
+bool MobileSetupDialog::IsDialogModal() const {
+ return false;
xiyuan 2011/10/15 15:56:19 Do we really want to use a modaless dialog? Withou
zel 2011/10/18 22:22:16 Done.
+}
+
+string16 MobileSetupDialog::GetDialogTitle() const {
+ return l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE);
+}
+
+GURL MobileSetupDialog::GetDialogContentURL() const {
+ return GURL(chrome::kChromeUIMobileSetupURL);
+}
+
+void MobileSetupDialog::GetWebUIMessageHandlers(
+ std::vector<WebUIMessageHandler*>* handlers) const{
+}
+
+void MobileSetupDialog::GetDialogSize(gfx::Size* size) const {
+ size->SetSize(850, 650);
+}
+
+std::string MobileSetupDialog::GetDialogArgs() const {
+ return std::string();
+}
+
+void MobileSetupDialog::OnDialogClosed(const std::string& json_retval) {
+}
+
+void MobileSetupDialog::OnCloseContents(TabContents* source,
+ bool* out_close_dialog) {
+ *out_close_dialog = true;
+}
+
+bool MobileSetupDialog::ShouldShowDialogTitle() const {
+ return true;
+}
+
+bool MobileSetupDialog::HandleContextMenu(const ContextMenuParams& params) {
+ return true;
xiyuan 2011/10/15 15:56:19 We might only want to return true for DEBUG build.
+}
Property changes on: chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698