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

Unified Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 199072: Add SSL icons on Mac OS X (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 side-by-side diff with in-line comments
Download patch
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];
+}

Powered by Google App Engine
This is Rietveld 408576698