diff options
author | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 18:57:47 +0000 |
---|---|---|
committer | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 18:57:47 +0000 |
commit | f7d1a045a3e62b0835b5da01f220f2238680207d (patch) | |
tree | 8edc67aed4616e562a114277718b8b7e330cbbb6 /chrome | |
parent | cdb2dd98cf24bcf1e0641986c2573f2da621555e (diff) | |
download | chromium_src-f7d1a045a3e62b0835b5da01f220f2238680207d.zip chromium_src-f7d1a045a3e62b0835b5da01f220f2238680207d.tar.gz chromium_src-f7d1a045a3e62b0835b5da01f220f2238680207d.tar.bz2 |
For readability review.
Review URL: http://codereview.chromium.org/6731022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc | 19 | ||||
-rw-r--r-- | chrome/browser/printing/cloud_print/cloud_print_setup_flow.h | 3 |
2 files changed, 17 insertions, 5 deletions
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc index a8ebbbb..ba5d2de 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc @@ -57,7 +57,8 @@ string16& DoneIframeXPath() { // static CloudPrintSetupFlow* CloudPrintSetupFlow::OpenDialog( - Profile* profile, const base::WeakPtr<Delegate>& delegate, + Profile* profile, + const base::WeakPtr<Delegate>& delegate, gfx::NativeWindow parent_window) { DCHECK(profile); // Set the arguments for showing the gaia login page. @@ -149,6 +150,17 @@ void CloudPrintSetupFlow::GetDialogSize(gfx::Size* size) const { } #if !defined(OS_WIN) + // NOTE(scottbyer):The following comment comes from + // SyncSetupFlow::GetDialogSize, where this hack was copied from. By starting + // off development of the UI on Windows, the hack is seemingly backwards. + + // NOTE(akalin): This is a hack to work around a problem with font height on + // windows. Basically font metrics are incorrectly returned in logical units + // instead of pixels on Windows. Logical units are very commonly 96 DPI + // so our localized char/line counts are too small by a factor of 96/72. + // So we compensate for this on non-windows platform. + + // TODO(scottbyer): Fix the root cause, kill the hacks. float scale_hack = 96.f/72.f; size->set_width(size->width() * scale_hack); size->set_height(size->height() * scale_hack); @@ -161,14 +173,13 @@ void CloudPrintSetupFlow::OnDialogClosed(const std::string& json_retval) { if (authenticator_.get()) authenticator_->CancelRequest(); - if (delegate_) { + if (delegate_) delegate_->OnDialogClosed(); - } delete this; } std::string CloudPrintSetupFlow::GetDialogArgs() const { - return dialog_start_args_; + return dialog_start_args_; } void CloudPrintSetupFlow::OnCloseContents(TabContents* source, diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h index 5be3b31..7ecc50b 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h @@ -116,7 +116,8 @@ class CloudPrintSetupFlow : public HtmlDialogUIDelegate, const string16& js); // Pointer to the Web UI. This is provided by CloudPrintSetupMessageHandler - // when attached. + // when attached. We do not own the pointer, instead WebUI owns it's delegate + // (us) and controls our lifetime. WebUI* web_ui_; // The args to pass to the initial page. |