| 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/chromeos/dom_ui/menu_ui.h" | 5 #include "chrome/browser/chromeos/dom_ui/menu_ui.h" |
| 6 | 6 |
| 7 #include "app/menus/menu_model.h" | 7 #include "app/menus/menu_model.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 strings.SetString("menu_source", menu_source.as_string()); | 190 strings.SetString("menu_source", menu_source.as_string()); |
| 191 } | 191 } |
| 192 if (menu_css_id == kNoExtraResource) { | 192 if (menu_css_id == kNoExtraResource) { |
| 193 strings.SetString("menu_css", ""); | 193 strings.SetString("menu_css", ""); |
| 194 } else { | 194 } else { |
| 195 base::StringPiece menu_css( | 195 base::StringPiece menu_css( |
| 196 ResourceBundle::GetSharedInstance().GetRawDataResource(menu_css_id)); | 196 ResourceBundle::GetSharedInstance().GetRawDataResource(menu_css_id)); |
| 197 strings.SetString("menu_css", menu_css.as_string()); | 197 strings.SetString("menu_css", menu_css.as_string()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 menu_ui.AddLocalizedStrings(&strings); |
| 201 |
| 200 return jstemplate_builder::GetI18nTemplateHtml(menu_template, &strings); | 202 return jstemplate_builder::GetI18nTemplateHtml(menu_template, &strings); |
| 201 } | 203 } |
| 202 | 204 |
| 203 class MenuUIHTMLSource : public ChromeURLDataManager::DataSource, | 205 class MenuUIHTMLSource : public ChromeURLDataManager::DataSource, |
| 204 public URLFetcher::Delegate { | 206 public URLFetcher::Delegate { |
| 205 public: | 207 public: |
| 206 MenuUIHTMLSource(const chromeos::MenuUI& menu_ui, | 208 MenuUIHTMLSource(const chromeos::MenuUI& menu_ui, |
| 207 const std::string& source_name, | 209 const std::string& source_name, |
| 208 const std::string& menu_class, | 210 const std::string& menu_class, |
| 209 int menu_source_id, | 211 int menu_source_id, |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 int menu_source_id, | 702 int menu_source_id, |
| 701 int menu_css_id) { | 703 int menu_css_id) { |
| 702 return new MenuUIHTMLSource(menu_ui, | 704 return new MenuUIHTMLSource(menu_ui, |
| 703 source_name, | 705 source_name, |
| 704 menu_class, | 706 menu_class, |
| 705 menu_source_id, | 707 menu_source_id, |
| 706 menu_css_id); | 708 menu_css_id); |
| 707 } | 709 } |
| 708 | 710 |
| 709 } // namespace chromeos | 711 } // namespace chromeos |
| OLD | NEW |