OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 size->set_height(size->height() * scale_hack); | 165 size->set_height(size->height() * scale_hack); |
166 #endif | 166 #endif |
167 } | 167 } |
168 | 168 |
169 // A callback to notify the delegate that the dialog closed. | 169 // A callback to notify the delegate that the dialog closed. |
170 void CloudPrintSetupFlow::OnDialogClosed(const std::string& json_retval) { | 170 void CloudPrintSetupFlow::OnDialogClosed(const std::string& json_retval) { |
171 // If we are fetching the token then cancel the request. | 171 // If we are fetching the token then cancel the request. |
172 if (authenticator_.get()) | 172 if (authenticator_.get()) |
173 authenticator_->CancelRequest(); | 173 authenticator_->CancelRequest(); |
174 | 174 |
175 if (delegate_) | 175 if (delegate_.get()) |
176 delegate_->OnDialogClosed(); | 176 delegate_->OnDialogClosed(); |
177 delete this; | 177 delete this; |
178 } | 178 } |
179 | 179 |
180 std::string CloudPrintSetupFlow::GetDialogArgs() const { | 180 std::string CloudPrintSetupFlow::GetDialogArgs() const { |
181 return dialog_start_args_; | 181 return dialog_start_args_; |
182 } | 182 } |
183 | 183 |
184 void CloudPrintSetupFlow::OnCloseContents(WebContents* source, | 184 void CloudPrintSetupFlow::OnCloseContents(WebContents* source, |
185 bool* out_close_dialog) { | 185 bool* out_close_dialog) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( | 335 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( |
336 const string16& iframe_xpath, | 336 const string16& iframe_xpath, |
337 const string16& js) { | 337 const string16& js) { |
338 if (web_ui_) { | 338 if (web_ui_) { |
339 content::RenderViewHost* rvh = | 339 content::RenderViewHost* rvh = |
340 web_ui_->GetWebContents()->GetRenderViewHost(); | 340 web_ui_->GetWebContents()->GetRenderViewHost(); |
341 rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); | 341 rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); |
342 } | 342 } |
343 } | 343 } |
OLD | NEW |