| Index: chrome/browser/cocoa/location_bar_view_mac.mm
|
| ===================================================================
|
| --- chrome/browser/cocoa/location_bar_view_mac.mm (revision 25790)
|
| +++ chrome/browser/cocoa/location_bar_view_mac.mm (working copy)
|
| @@ -56,6 +56,7 @@
|
| field_(field),
|
| disposition_(CURRENT_TAB),
|
| profile_(profile),
|
| + toolbar_model_(toolbar_model),
|
| transition_(PageTransition::TYPED) {
|
| }
|
|
|
| @@ -107,6 +108,7 @@
|
|
|
| void LocationBarViewMac::Update(const TabContents* contents,
|
| bool should_restore_state) {
|
| + SetSecurityIcon(toolbar_model_->GetIcon());
|
| // AutocompleteEditView restores state if the tab is non-NULL.
|
| edit_view_->Update(should_restore_state ? contents : NULL);
|
| }
|
| @@ -221,7 +223,8 @@
|
| }
|
|
|
| void LocationBarViewMac::OnInputInProgress(bool in_progress) {
|
| - NOTIMPLEMENTED();
|
| + toolbar_model_->set_input_in_progress(in_progress);
|
| + Update(NULL, false);
|
| }
|
|
|
| void LocationBarViewMac::OnSetFocus() {
|
| @@ -256,3 +259,23 @@
|
| }
|
| return tab_button_image_;
|
| }
|
| +
|
| +void LocationBarViewMac::SetSecurityIcon(ToolbarModel::Icon security_icon) {
|
| + ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| + AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell];
|
| + switch (security_icon) {
|
| + case ToolbarModel::LOCK_ICON:
|
| + [cell setHintIcon:rb.GetNSImageNamed(IDR_LOCK)];
|
| + break;
|
| + case ToolbarModel::WARNING_ICON:
|
| + [cell setHintIcon:rb.GetNSImageNamed(IDR_WARNING)];
|
| + break;
|
| + case ToolbarModel::NO_ICON:
|
| + [cell setHintIcon:nil];
|
| + break;
|
| + default:
|
| + NOTREACHED();
|
| + break;
|
| + }
|
| + [field_ resetFieldEditorFrameIfNeeded];
|
| +}
|
|
|