OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "content/browser/renderer_host/render_view_host.h" | 30 #include "content/browser/renderer_host/render_view_host.h" |
31 #include "content/browser/tab_contents/tab_contents.h" | 31 #include "content/browser/tab_contents/tab_contents.h" |
32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
33 #include "grit/chromium_strings.h" | 33 #include "grit/chromium_strings.h" |
34 #include "grit/locale_settings.h" | 34 #include "grit/locale_settings.h" |
35 #include "ui/base/l10n/l10n_font_util.h" | 35 #include "ui/base/l10n/l10n_font_util.h" |
36 #include "ui/gfx/font.h" | 36 #include "ui/gfx/font.h" |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 string16& SetupIframeXPath() { | 40 string16 SetupIframeXPath() { |
41 static string16 kSetupIframeXPath = | 41 return ASCIIToUTF16("//iframe[@id='cloudprintsetup']"); |
42 ASCIIToUTF16("//iframe[@id='cloudprintsetup']"); | |
43 return kSetupIframeXPath; | |
44 } | 42 } |
45 | 43 |
46 string16& DoneIframeXPath() { | 44 string16 DoneIframeXPath() { |
47 static string16 kDoneIframeXPath = | 45 return ASCIIToUTF16("//iframe[@id='setupdone']"); |
48 ASCIIToUTF16("//iframe[@id='setupdone']"); | |
49 return kDoneIframeXPath; | |
50 } | 46 } |
51 | 47 |
52 } // end namespace | 48 } // end namespace |
53 | 49 |
54 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
55 // CloudPrintSetupFlow implementation. | 51 // CloudPrintSetupFlow implementation. |
56 | 52 |
57 // static | 53 // static |
58 CloudPrintSetupFlow* CloudPrintSetupFlow::OpenDialog( | 54 CloudPrintSetupFlow* CloudPrintSetupFlow::OpenDialog( |
59 Profile* profile, | 55 Profile* profile, |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 326 } |
331 | 327 |
332 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( | 328 void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( |
333 const string16& iframe_xpath, | 329 const string16& iframe_xpath, |
334 const string16& js) { | 330 const string16& js) { |
335 if (web_ui_) { | 331 if (web_ui_) { |
336 RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); | 332 RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); |
337 rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); | 333 rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); |
338 } | 334 } |
339 } | 335 } |
OLD | NEW |