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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.h

Issue 23980003: Save password functionality added to the save password bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
14 #include "chrome/common/content_settings.h" 15 #include "chrome/common/content_settings.h"
15 #include "chrome/common/custom_handlers/protocol_handler.h" 16 #include "chrome/common/custom_handlers/protocol_handler.h"
16 #include "content/public/browser/notification_observer.h" 17 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 18 #include "content/public/browser/notification_registrar.h"
18 #include "content/public/common/media_stream_request.h" 19 #include "content/public/common/media_stream_request.h"
19 #include "ui/gfx/image/image.h" 20 #include "ui/gfx/image/image.h"
20 #include "url/gurl.h" 21 #include "url/gurl.h"
21 22
22 class ContentSettingBubbleModelDelegate; 23 class ContentSettingBubbleModelDelegate;
23 class Profile; 24 class Profile;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const content::NotificationSource& source, 106 const content::NotificationSource& source,
106 const content::NotificationDetails& details) OVERRIDE; 107 const content::NotificationDetails& details) OVERRIDE;
107 108
108 virtual void OnRadioClicked(int radio_index) {} 109 virtual void OnRadioClicked(int radio_index) {}
109 virtual void OnPopupClicked(int index) {} 110 virtual void OnPopupClicked(int index) {}
110 virtual void OnCustomLinkClicked() {} 111 virtual void OnCustomLinkClicked() {}
111 virtual void OnManageLinkClicked() {} 112 virtual void OnManageLinkClicked() {}
112 virtual void OnMediaMenuClicked(content::MediaStreamType type, 113 virtual void OnMediaMenuClicked(content::MediaStreamType type,
113 const std::string& selected_device_id) {} 114 const std::string& selected_device_id) {}
114 115
116 // Called by the view code when the cancel button in clicked by the user.
117 virtual void OnCancelClicked() {}
118
115 // Called by the view code when the bubble is closed by the user using the 119 // Called by the view code when the bubble is closed by the user using the
116 // Done button. 120 // Done button.
117 virtual void OnDoneClicked() {} 121 virtual void OnDoneClicked() {}
118 122
123 // Called by the view code when the save button in clicked by the user.
124 virtual void OnSaveClicked() {}
125
119 protected: 126 protected:
120 ContentSettingBubbleModel( 127 ContentSettingBubbleModel(
121 content::WebContents* web_contents, 128 content::WebContents* web_contents,
122 Profile* profile, 129 Profile* profile,
123 ContentSettingsType content_type); 130 ContentSettingsType content_type);
124 131
125 content::WebContents* web_contents() const { return web_contents_; } 132 content::WebContents* web_contents() const { return web_contents_; }
126 Profile* profile() const { return profile_; } 133 Profile* profile() const { return profile_; }
127 134
128 void set_title(const std::string& title) { bubble_content_.title = title; } 135 void set_title(const std::string& title) { bubble_content_.title = title; }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 184
178 private: 185 private:
179 void SetBlockedResources(); 186 void SetBlockedResources();
180 void SetTitle(); 187 void SetTitle();
181 void SetManageLink(); 188 void SetManageLink();
182 virtual void OnManageLinkClicked() OVERRIDE; 189 virtual void OnManageLinkClicked() OVERRIDE;
183 190
184 Delegate* delegate_; 191 Delegate* delegate_;
185 }; 192 };
186 193
194 class SavePasswordBubbleModel : public ContentSettingTitleAndLinkModel {
195 public:
196 SavePasswordBubbleModel(Delegate* delegate,
197 content::WebContents* web_contents,
198 Profile* profile);
199 virtual ~SavePasswordBubbleModel() {}
Peter Kasting 2013/09/09 18:19:02 Nit: Don't define virtual functions inline (even e
npentrel 2013/09/09 22:08:34 Done.
200 virtual void OnCancelClicked() OVERRIDE;
201 virtual void OnSaveClicked() OVERRIDE;
202 private:
Peter Kasting 2013/09/09 18:19:02 Nit: Blank line above
npentrel 2013/09/09 22:08:34 Done.
203 // Sets the title of the bubble.
Peter Kasting 2013/09/09 18:19:02 Nit: This comment adds nothing to the function nam
npentrel 2013/09/09 22:08:34 Done.
204 void SetTitle();
205
206 TabSpecificContentSettings::PasswordSavingState state_;
207
208 DISALLOW_COPY_AND_ASSIGN(SavePasswordBubbleModel);
209 };
210
187 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { 211 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel {
188 public: 212 public:
189 ContentSettingRPHBubbleModel(Delegate* delegate, 213 ContentSettingRPHBubbleModel(Delegate* delegate,
190 content::WebContents* web_contents, 214 content::WebContents* web_contents,
191 Profile* profile, 215 Profile* profile,
192 ProtocolHandlerRegistry* registry, 216 ProtocolHandlerRegistry* registry,
193 ContentSettingsType content_type); 217 ContentSettingsType content_type);
194 218
195 virtual void OnRadioClicked(int radio_index) OVERRIDE; 219 virtual void OnRadioClicked(int radio_index) OVERRIDE;
196 virtual void OnDoneClicked() OVERRIDE; 220 virtual void OnDoneClicked() OVERRIDE;
(...skipping 12 matching lines...) Expand all
209 void IgnoreProtocolHandler(); 233 void IgnoreProtocolHandler();
210 void ClearOrSetPreviousHandler(); 234 void ClearOrSetPreviousHandler();
211 235
212 int selected_item_; 236 int selected_item_;
213 ProtocolHandlerRegistry* registry_; 237 ProtocolHandlerRegistry* registry_;
214 ProtocolHandler pending_handler_; 238 ProtocolHandler pending_handler_;
215 ProtocolHandler previous_handler_; 239 ProtocolHandler previous_handler_;
216 }; 240 };
217 241
218 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ 242 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698