| 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/autocomplete/autocomplete_edit_view_mac.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> // kVK_Return | 7 #include <Carbon/Carbon.h> // kVK_Return |
| 8 | 8 |
| 9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
| 10 #include "app/clipboard/scoped_clipboard_writer.h" | 10 #include "app/clipboard/scoped_clipboard_writer.h" |
| 11 #include "app/mac/nsimage_cache.h" |
| 11 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
| 12 #include "base/nsimage_cache_mac.h" | |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 16 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 17 #include "chrome/browser/autocomplete/autocomplete_match.h" | 17 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 19 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" | 19 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" |
| 20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/tab_contents/tab_contents.h" | 21 #include "chrome/browser/tab_contents/tab_contents.h" |
| 22 #include "chrome/browser/ui/cocoa/event_utils.h" | 22 #include "chrome/browser/ui/cocoa/event_utils.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Values from |ToolbarModel::GetIcon()|. | 142 // Values from |ToolbarModel::GetIcon()|. |
| 143 case IDR_OMNIBOX_HTTPS_VALID: | 143 case IDR_OMNIBOX_HTTPS_VALID: |
| 144 image_name = @"omnibox_https_valid.pdf"; break; | 144 image_name = @"omnibox_https_valid.pdf"; break; |
| 145 case IDR_OMNIBOX_HTTPS_WARNING: | 145 case IDR_OMNIBOX_HTTPS_WARNING: |
| 146 image_name = @"omnibox_https_warning.pdf"; break; | 146 image_name = @"omnibox_https_warning.pdf"; break; |
| 147 case IDR_OMNIBOX_HTTPS_INVALID: | 147 case IDR_OMNIBOX_HTTPS_INVALID: |
| 148 image_name = @"omnibox_https_invalid.pdf"; break; | 148 image_name = @"omnibox_https_invalid.pdf"; break; |
| 149 } | 149 } |
| 150 | 150 |
| 151 if (image_name) { | 151 if (image_name) { |
| 152 if (NSImage* image = nsimage_cache::ImageNamed(image_name)) { | 152 if (NSImage* image = app::mac::GetCachedImageWithName(image_name)) { |
| 153 return image; | 153 return image; |
| 154 } else { | 154 } else { |
| 155 NOTREACHED() | 155 NOTREACHED() |
| 156 << "Missing image for " << base::SysNSStringToUTF8(image_name); | 156 << "Missing image for " << base::SysNSStringToUTF8(image_name); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 160 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 161 return rb.GetNativeImageNamed(resource_id); | 161 return rb.GetNativeImageNamed(resource_id); |
| 162 } | 162 } |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 return std::wstring(); | 1082 return std::wstring(); |
| 1083 } | 1083 } |
| 1084 | 1084 |
| 1085 // static | 1085 // static |
| 1086 NSFont* AutocompleteEditViewMac::GetFieldFont() { | 1086 NSFont* AutocompleteEditViewMac::GetFieldFont() { |
| 1087 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1087 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 1088 return rb.GetFont(ResourceBundle::BaseFont).GetNativeFont(); | 1088 return rb.GetFont(ResourceBundle::BaseFont).GetNativeFont(); |
| 1089 } | 1089 } |
| OLD | NEW |