Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 194110: Convert the AutocompletePopupPositioner into a BubblePositioner in preparatio... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #import "chrome/browser/cocoa/location_bar_view_mac.h" 5 #import "chrome/browser/cocoa/location_bar_view_mac.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 27 matching lines...) Expand all
38 // to track changes to the model, this should become a DCHECK. 38 // to track changes to the model, this should become a DCHECK.
39 const TemplateURL* template_url = 39 const TemplateURL* template_url =
40 profile->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword); 40 profile->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword);
41 if (template_url) 41 if (template_url)
42 return template_url->AdjustedShortNameForLocaleDirection(); 42 return template_url->AdjustedShortNameForLocaleDirection();
43 return std::wstring(); 43 return std::wstring();
44 } 44 }
45 45
46 } // namespace 46 } // namespace
47 47
48 LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field, 48 LocationBarViewMac::LocationBarViewMac(
49 AutocompletePopupPositioner* positioner, 49 AutocompleteTextField* field,
50 CommandUpdater* command_updater, 50 const BubblePositioner* bubble_positioner,
51 ToolbarModel* toolbar_model, 51 CommandUpdater* command_updater,
52 Profile* profile) 52 ToolbarModel* toolbar_model,
53 : edit_view_(new AutocompleteEditViewMac(this, positioner, toolbar_model, 53 Profile* profile)
54 profile, command_updater, field)), 54 : edit_view_(new AutocompleteEditViewMac(this, bubble_positioner,
55 toolbar_model, profile, command_updater, field)),
55 command_updater_(command_updater), 56 command_updater_(command_updater),
56 field_(field), 57 field_(field),
57 disposition_(CURRENT_TAB), 58 disposition_(CURRENT_TAB),
58 profile_(profile), 59 profile_(profile),
59 transition_(PageTransition::TYPED) { 60 transition_(PageTransition::TYPED) {
60 } 61 }
61 62
62 LocationBarViewMac::~LocationBarViewMac() { 63 LocationBarViewMac::~LocationBarViewMac() {
63 // TODO(shess): Placeholder for omnibox changes. 64 // TODO(shess): Placeholder for omnibox changes.
64 } 65 }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 NSImage* LocationBarViewMac::GetTabButtonImage() { 255 NSImage* LocationBarViewMac::GetTabButtonImage() {
255 if (!tab_button_image_) { 256 if (!tab_button_image_) {
256 SkBitmap* skiaBitmap = ResourceBundle::GetSharedInstance(). 257 SkBitmap* skiaBitmap = ResourceBundle::GetSharedInstance().
257 GetBitmapNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB); 258 GetBitmapNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB);
258 if (skiaBitmap) { 259 if (skiaBitmap) {
259 tab_button_image_.reset([gfx::SkBitmapToNSImage(*skiaBitmap) retain]); 260 tab_button_image_.reset([gfx::SkBitmapToNSImage(*skiaBitmap) retain]);
260 } 261 }
261 } 262 }
262 return tab_button_image_; 263 return tab_button_image_;
263 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698