OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
6 | 6 |
7 #include "app/gfx/font_util.h" | 7 #include "app/gfx/font_util.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (delegate_) { | 158 if (delegate_) { |
159 delegate_->OnDialogClosed(); | 159 delegate_->OnDialogClosed(); |
160 } | 160 } |
161 delete this; | 161 delete this; |
162 } | 162 } |
163 | 163 |
164 std::string CloudPrintSetupFlow::GetDialogArgs() const { | 164 std::string CloudPrintSetupFlow::GetDialogArgs() const { |
165 return dialog_start_args_; | 165 return dialog_start_args_; |
166 } | 166 } |
167 | 167 |
168 void CloudPrintSetupFlow::OnCloseContents(TabContents* source, | 168 void CloudPrintSetupFlow::OnCloseContents(TabContents* source, |
169 bool* out_close_dialog) { | 169 bool* out_close_dialog) { |
170 } | 170 } |
171 | 171 |
172 std::wstring CloudPrintSetupFlow::GetDialogTitle() const { | 172 std::wstring CloudPrintSetupFlow::GetDialogTitle() const { |
173 return l10n_util::GetString(IDS_CLOUD_PRINT_SETUP_DIALOG_TITLE); | 173 return l10n_util::GetString(IDS_CLOUD_PRINT_SETUP_DIALOG_TITLE); |
174 } | 174 } |
175 | 175 |
176 bool CloudPrintSetupFlow::IsDialogModal() const { | 176 bool CloudPrintSetupFlow::IsDialogModal() const { |
177 // We are always modeless. | 177 // We are always modeless. |
178 return false; | 178 return false; |
179 } | 179 } |
180 | 180 |
| 181 bool CloudPrintSetupFlow::ShouldShowDialogTitle() const { |
| 182 return true; |
| 183 } |
| 184 |
181 /////////////////////////////////////////////////////////////////////////////// | 185 /////////////////////////////////////////////////////////////////////////////// |
182 // GaiaAuthConsumer implementation. | 186 // GaiaAuthConsumer implementation. |
183 void CloudPrintSetupFlow::OnClientLoginFailure( | 187 void CloudPrintSetupFlow::OnClientLoginFailure( |
184 const GoogleServiceAuthError& error) { | 188 const GoogleServiceAuthError& error) { |
185 ShowGaiaFailed(error); | 189 ShowGaiaFailed(error); |
186 authenticator_.reset(); | 190 authenticator_.reset(); |
187 } | 191 } |
188 | 192 |
189 void CloudPrintSetupFlow::OnClientLoginSuccess( | 193 void CloudPrintSetupFlow::OnClientLoginSuccess( |
190 const GaiaAuthConsumer::ClientLoginResult& credentials) { | 194 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 297 } |
294 | 298 |
295 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( | 299 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( |
296 const std::wstring& iframe_xpath, | 300 const std::wstring& iframe_xpath, |
297 const std::wstring& js) { | 301 const std::wstring& js) { |
298 if (dom_ui_) { | 302 if (dom_ui_) { |
299 RenderViewHost* rvh = dom_ui_->tab_contents()->render_view_host(); | 303 RenderViewHost* rvh = dom_ui_->tab_contents()->render_view_host(); |
300 rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); | 304 rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); |
301 } | 305 } |
302 } | 306 } |
OLD | NEW |