Commit 0159484e authored by gbillock@chromium.org's avatar gbillock@chromium.org

Add done-clicked notification to content settings bubble model.

Add RPH use for said notification to clear the setting affordance from the location bar.

R=bauerb@chromium.org
BUG=None
TEST=None


Review URL: https://chromiumcodereview.appspot.com/10821059

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149210 0039d316-1c4b-4281-b951-d872f2087c98
parent e037cd16
...@@ -486,6 +486,7 @@ NSTextField* LabelWithFrame(NSString* text, const NSRect& frame) { ...@@ -486,6 +486,7 @@ NSTextField* LabelWithFrame(NSString* text, const NSRect& frame) {
} }
- (IBAction)closeBubble:(id)sender { - (IBAction)closeBubble:(id)sender {
contentSettingBubbleModel_->OnDoneClicked();
[self close]; [self close];
} }
......
...@@ -691,6 +691,16 @@ void ContentSettingRPHBubbleModel::OnRadioClicked(int radio_index) { ...@@ -691,6 +691,16 @@ void ContentSettingRPHBubbleModel::OnRadioClicked(int radio_index) {
NOTREACHED(); NOTREACHED();
} }
void ContentSettingRPHBubbleModel::OnDoneClicked() {
// The user has one chance to deal with the RPH content setting UI,
// then we remove it.
tab_contents()->content_settings()->ClearPendingProtocolHandler();
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED,
content::Source<WebContents>(tab_contents()->web_contents()),
content::NotificationService::NoDetails());
}
void ContentSettingRPHBubbleModel::RegisterProtocolHandler() { void ContentSettingRPHBubbleModel::RegisterProtocolHandler() {
// A no-op if the handler hasn't been ignored, but needed in case the user // A no-op if the handler hasn't been ignored, but needed in case the user
// selects sequences like register/ignore/register. // selects sequences like register/ignore/register.
......
...@@ -94,6 +94,10 @@ class ContentSettingBubbleModel : public content::NotificationObserver { ...@@ -94,6 +94,10 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
virtual void OnCustomLinkClicked() {} virtual void OnCustomLinkClicked() {}
virtual void OnManageLinkClicked() {} virtual void OnManageLinkClicked() {}
// Called by the view code when the bubble is closed by the user using the
// Done button.
virtual void OnDoneClicked() {}
protected: protected:
ContentSettingBubbleModel(TabContents* tab_contents, Profile* profile, ContentSettingBubbleModel(TabContents* tab_contents, Profile* profile,
ContentSettingsType content_type); ContentSettingsType content_type);
...@@ -163,6 +167,7 @@ class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { ...@@ -163,6 +167,7 @@ class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel {
ContentSettingsType content_type); ContentSettingsType content_type);
virtual void OnRadioClicked(int radio_index) OVERRIDE; virtual void OnRadioClicked(int radio_index) OVERRIDE;
virtual void OnDoneClicked() OVERRIDE;
private: private:
// These states must match the order of appearance of the radio buttons // These states must match the order of appearance of the radio buttons
......
...@@ -304,6 +304,7 @@ void ContentSettingBubbleGtk::OnRadioToggled(GtkWidget* widget) { ...@@ -304,6 +304,7 @@ void ContentSettingBubbleGtk::OnRadioToggled(GtkWidget* widget) {
} }
void ContentSettingBubbleGtk::OnCloseButtonClicked(GtkWidget *button) { void ContentSettingBubbleGtk::OnCloseButtonClicked(GtkWidget *button) {
content_setting_bubble_model_->OnDoneClicked();
Close(); Close();
} }
......
...@@ -288,6 +288,7 @@ void ContentSettingBubbleContents::Init() { ...@@ -288,6 +288,7 @@ void ContentSettingBubbleContents::Init() {
void ContentSettingBubbleContents::ButtonPressed(views::Button* sender, void ContentSettingBubbleContents::ButtonPressed(views::Button* sender,
const views::Event& event) { const views::Event& event) {
if (sender == close_button_) { if (sender == close_button_) {
content_setting_bubble_model_->OnDoneClicked();
StartFade(false); StartFade(false);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment