| 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/chromeos/webui/menu_ui.h" | 5 #include "chrome/browser/chromeos/webui/menu_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 out.append("italic "); | 57 out.append("italic "); |
| 58 } | 58 } |
| 59 if (font->GetStyle() & gfx::Font::UNDERLINED) { | 59 if (font->GetStyle() & gfx::Font::UNDERLINED) { |
| 60 out.append("underline "); | 60 out.append("underline "); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // TODO(oshima): The font size from gfx::Font is too small when | 63 // TODO(oshima): The font size from gfx::Font is too small when |
| 64 // used in webkit. Figure out the reason. | 64 // used in webkit. Figure out the reason. |
| 65 out.append(base::IntToString(font->GetFontSize() + 4)); | 65 out.append(base::IntToString(font->GetFontSize() + 4)); |
| 66 out.append("px/"); | 66 out.append("px/"); |
| 67 out.append(base::IntToString(std::max(kFavIconSize, font->GetHeight()))); | 67 out.append(base::IntToString(std::max(kFaviconSize, font->GetHeight()))); |
| 68 out.append("px \""); | 68 out.append("px \""); |
| 69 out.append(UTF16ToUTF8(font->GetFontName())); | 69 out.append(UTF16ToUTF8(font->GetFontName())); |
| 70 out.append("\",sans-serif"); | 70 out.append("\",sans-serif"); |
| 71 return out; | 71 return out; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Creates scroll button's up image when |up| is true or | 74 // Creates scroll button's up image when |up| is true or |
| 75 // down image if |up| is false. | 75 // down image if |up| is false. |
| 76 SkBitmap CreateMenuScrollArrowImage(bool up) { | 76 SkBitmap CreateMenuScrollArrowImage(bool up) { |
| 77 const views::MenuConfig& config = views::MenuConfig::instance(); | 77 const views::MenuConfig& config = views::MenuConfig::instance(); |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 | 646 |
| 647 ChromeURLDataManager::DataSource* MenuUI::CreateDataSource() { | 647 ChromeURLDataManager::DataSource* MenuUI::CreateDataSource() { |
| 648 return CreateMenuUIHTMLSource(NULL, | 648 return CreateMenuUIHTMLSource(NULL, |
| 649 chrome::kChromeUIMenu, | 649 chrome::kChromeUIMenu, |
| 650 "Menu" /* class name */, | 650 "Menu" /* class name */, |
| 651 kNoExtraResource, | 651 kNoExtraResource, |
| 652 kNoExtraResource); | 652 kNoExtraResource); |
| 653 } | 653 } |
| 654 | 654 |
| 655 } // namespace chromeos | 655 } // namespace chromeos |
| OLD | NEW |