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

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

Issue 11446034: SupportsUserData and manifest handlers for Extension; use them for the Omnibox API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/ui/cocoa/location_bar/location_bar_view_mac.h" 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/sys_string_conversions.h" 12 #include "base/sys_string_conversions.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/alternate_nav_url_fetcher.h" 15 #include "chrome/browser/alternate_nav_url_fetcher.h"
16 #import "chrome/browser/app_controller_mac.h" 16 #import "chrome/browser/app_controller_mac.h"
17 #include "chrome/browser/command_updater.h" 17 #include "chrome/browser/command_updater.h"
18 #include "chrome/browser/defaults.h" 18 #include "chrome/browser/defaults.h"
19 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h"
19 #include "chrome/browser/extensions/api/tabs/tabs.h" 20 #include "chrome/browser/extensions/api/tabs/tabs.h"
20 #include "chrome/browser/extensions/extension_action.h" 21 #include "chrome/browser/extensions/extension_action.h"
21 #include "chrome/browser/extensions/extension_service.h"
22 #include "chrome/browser/extensions/extension_system.h"
23 #include "chrome/browser/extensions/location_bar_controller.h" 22 #include "chrome/browser/extensions/location_bar_controller.h"
24 #include "chrome/browser/extensions/tab_helper.h" 23 #include "chrome/browser/extensions/tab_helper.h"
25 #include "chrome/browser/prefs/pref_service.h" 24 #include "chrome/browser/prefs/pref_service.h"
26 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/search_engines/template_url.h" 26 #include "chrome/browser/search_engines/template_url.h"
28 #include "chrome/browser/search_engines/template_url_service.h" 27 #include "chrome/browser/search_engines/template_url_service.h"
29 #include "chrome/browser/search_engines/template_url_service_factory.h" 28 #include "chrome/browser/search_engines/template_url_service_factory.h"
30 #include "chrome/browser/ui/browser_instant_controller.h" 29 #include "chrome/browser/ui/browser_instant_controller.h"
31 #include "chrome/browser/ui/browser_list.h" 30 #include "chrome/browser/ui/browser_list.h"
32 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h " 31 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h "
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 const NSPoint point = 557 const NSPoint point =
559 location_icon_decoration_->GetBubblePointInFrame(frame); 558 location_icon_decoration_->GetBubblePointInFrame(frame);
560 return [field_ convertPoint:point toView:nil]; 559 return [field_ convertPoint:point toView:nil];
561 } 560 }
562 } 561 }
563 562
564 NSImage* LocationBarViewMac::GetKeywordImage(const string16& keyword) { 563 NSImage* LocationBarViewMac::GetKeywordImage(const string16& keyword) {
565 const TemplateURL* template_url = TemplateURLServiceFactory::GetForProfile( 564 const TemplateURL* template_url = TemplateURLServiceFactory::GetForProfile(
566 profile_)->GetTemplateURLForKeyword(keyword); 565 profile_)->GetTemplateURLForKeyword(keyword);
567 if (template_url && template_url->IsExtensionKeyword()) { 566 if (template_url && template_url->IsExtensionKeyword()) {
568 return extensions::ExtensionSystem::Get(profile_)->extension_service()-> 567 return extensions::OmniboxAPI::Get(profile_)->
569 GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage(); 568 GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage();
570 } 569 }
571 570
572 return OmniboxViewMac::ImageForResource(IDR_OMNIBOX_SEARCH); 571 return OmniboxViewMac::ImageForResource(IDR_OMNIBOX_SEARCH);
573 } 572 }
574 573
575 void LocationBarViewMac::Observe(int type, 574 void LocationBarViewMac::Observe(int type,
576 const content::NotificationSource& source, 575 const content::NotificationSource& source,
577 const content::NotificationDetails& details) { 576 const content::NotificationDetails& details) {
578 switch (type) { 577 switch (type) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 visible = false; 778 visible = false;
780 star_decoration_->SetVisible(visible); 779 star_decoration_->SetVisible(visible);
781 } 780 }
782 781
783 void LocationBarViewMac::UpdatePlusDecorationVisibility() { 782 void LocationBarViewMac::UpdatePlusDecorationVisibility() {
784 if (extensions::FeatureSwitch::action_box()->IsEnabled()) { 783 if (extensions::FeatureSwitch::action_box()->IsEnabled()) {
785 // If the action box is enabled, hide it when input is in progress. 784 // If the action box is enabled, hide it when input is in progress.
786 plus_decoration_->SetVisible(!toolbar_model_->GetInputInProgress()); 785 plus_decoration_->SetVisible(!toolbar_model_->GetInputInProgress());
787 } 786 }
788 } 787 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698