OLD | NEW |
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 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/content_settings/content_settings_utils.h" | 8 #include "chrome/browser/content_settings/content_settings_utils.h" |
9 #include "chrome/browser/content_settings/cookie_settings.h" | 9 #include "chrome/browser/content_settings/cookie_settings.h" |
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
11 #include "chrome/browser/favicon/favicon_tab_helper.h" | 11 #include "chrome/browser/favicon/favicon_tab_helper.h" |
12 #include "chrome/browser/infobars/infobar_tab_helper.h" | 12 #include "chrome/browser/infobars/infobar_tab_helper.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 15 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
16 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" | 16 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser_show_actions.h" |
18 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 18 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
21 #include "chrome/common/content_settings.h" | 21 #include "chrome/common/content_settings.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
23 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
24 #include "content/browser/renderer_host/render_view_host.h" | 24 #include "content/browser/renderer_host/render_view_host.h" |
25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
26 #include "content/public/browser/user_metrics.h" | 26 #include "content/public/browser/user_metrics.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
(...skipping 22 matching lines...) Expand all Loading... |
50 if (entries[i].type == type) | 50 if (entries[i].type == type) |
51 return entries[i].id; | 51 return entries[i].id; |
52 } | 52 } |
53 return 0; | 53 return 0; |
54 } | 54 } |
55 | 55 |
56 } // namespace | 56 } // namespace |
57 | 57 |
58 class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel { | 58 class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel { |
59 public: | 59 public: |
60 ContentSettingTitleAndLinkModel(Browser* browser, | 60 ContentSettingTitleAndLinkModel(Delegate* delegate, |
61 TabContentsWrapper* tab_contents, | 61 TabContentsWrapper* tab_contents, |
62 Profile* profile, | 62 Profile* profile, |
63 ContentSettingsType content_type) | 63 ContentSettingsType content_type) |
64 : ContentSettingBubbleModel(tab_contents, profile, content_type), | 64 : ContentSettingBubbleModel(tab_contents, profile, content_type), |
65 browser_(browser) { | 65 delegate_(delegate) { |
66 // Notifications do not have a bubble. | 66 // Notifications do not have a bubble. |
67 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 67 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
68 SetBlockedResources(); | 68 SetBlockedResources(); |
69 SetTitle(); | 69 SetTitle(); |
70 SetManageLink(); | 70 SetManageLink(); |
71 } | 71 } |
72 | 72 |
73 virtual ~ContentSettingTitleAndLinkModel() {} | 73 virtual ~ContentSettingTitleAndLinkModel() {} |
74 Browser* browser() const { return browser_; } | 74 Delegate* delegate() const { return delegate_; } |
75 | 75 |
76 private: | 76 private: |
77 void SetBlockedResources() { | 77 void SetBlockedResources() { |
78 TabSpecificContentSettings* settings = tab_contents()->content_settings(); | 78 TabSpecificContentSettings* settings = tab_contents()->content_settings(); |
79 const std::set<std::string>& resources = settings->BlockedResourcesForType( | 79 const std::set<std::string>& resources = settings->BlockedResourcesForType( |
80 content_type()); | 80 content_type()); |
81 for (std::set<std::string>::const_iterator it = resources.begin(); | 81 for (std::set<std::string>::const_iterator it = resources.begin(); |
82 it != resources.end(); ++it) { | 82 it != resources.end(); ++it) { |
83 AddBlockedResource(*it); | 83 AddBlockedResource(*it); |
84 } | 84 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_LINK}, | 124 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_LINK}, |
125 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LINK}, | 125 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LINK}, |
126 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_LINK}, | 126 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_LINK}, |
127 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_GEOLOCATION_BUBBLE_MANAGE_LINK}, | 127 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_GEOLOCATION_BUBBLE_MANAGE_LINK}, |
128 }; | 128 }; |
129 set_manage_link(l10n_util::GetStringUTF8( | 129 set_manage_link(l10n_util::GetStringUTF8( |
130 GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type()))); | 130 GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type()))); |
131 } | 131 } |
132 | 132 |
133 virtual void OnManageLinkClicked() { | 133 virtual void OnManageLinkClicked() { |
134 if (browser_) | 134 if (delegate_) |
135 browser_->ShowContentSettingsPage(content_type()); | 135 delegate_->ShowContentSettingsPage(content_type()); |
136 } | 136 } |
137 | 137 |
138 Browser* browser_; | 138 Delegate* delegate_; |
139 }; | 139 }; |
140 | 140 |
141 class ContentSettingTitleLinkAndCustomModel | 141 class ContentSettingTitleLinkAndCustomModel |
142 : public ContentSettingTitleAndLinkModel { | 142 : public ContentSettingTitleAndLinkModel { |
143 public: | 143 public: |
144 ContentSettingTitleLinkAndCustomModel(Browser* browser, | 144 ContentSettingTitleLinkAndCustomModel(Delegate* delegate, |
145 TabContentsWrapper* tab_contents, | 145 TabContentsWrapper* tab_contents, |
146 Profile* profile, | 146 Profile* profile, |
147 ContentSettingsType content_type) | 147 ContentSettingsType content_type) |
148 : ContentSettingTitleAndLinkModel( | 148 : ContentSettingTitleAndLinkModel( |
149 browser, tab_contents, profile, content_type) { | 149 delegate, tab_contents, profile, content_type) { |
150 SetCustomLink(); | 150 SetCustomLink(); |
151 } | 151 } |
152 | 152 |
153 virtual ~ContentSettingTitleLinkAndCustomModel() {} | 153 virtual ~ContentSettingTitleLinkAndCustomModel() {} |
154 | 154 |
155 private: | 155 private: |
156 void SetCustomLink() { | 156 void SetCustomLink() { |
157 static const ContentSettingsTypeIdEntry kCustomIDs[] = { | 157 static const ContentSettingsTypeIdEntry kCustomIDs[] = { |
158 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_INFO}, | 158 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_INFO}, |
159 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LOAD_ALL}, | 159 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LOAD_ALL}, |
160 }; | 160 }; |
161 int custom_link_id = | 161 int custom_link_id = |
162 GetIdForContentType(kCustomIDs, arraysize(kCustomIDs), content_type()); | 162 GetIdForContentType(kCustomIDs, arraysize(kCustomIDs), content_type()); |
163 if (custom_link_id) | 163 if (custom_link_id) |
164 set_custom_link(l10n_util::GetStringUTF8(custom_link_id)); | 164 set_custom_link(l10n_util::GetStringUTF8(custom_link_id)); |
165 } | 165 } |
166 | 166 |
167 virtual void OnCustomLinkClicked() {} | 167 virtual void OnCustomLinkClicked() {} |
168 }; | 168 }; |
169 | 169 |
170 | 170 |
171 class ContentSettingSingleRadioGroup | 171 class ContentSettingSingleRadioGroup |
172 : public ContentSettingTitleLinkAndCustomModel { | 172 : public ContentSettingTitleLinkAndCustomModel { |
173 public: | 173 public: |
174 ContentSettingSingleRadioGroup(Browser* browser, | 174 ContentSettingSingleRadioGroup(Delegate* delegate, |
175 TabContentsWrapper* tab_contents, | 175 TabContentsWrapper* tab_contents, |
176 Profile* profile, | 176 Profile* profile, |
177 ContentSettingsType content_type) | 177 ContentSettingsType content_type) |
178 : ContentSettingTitleLinkAndCustomModel(browser, tab_contents, profile, | 178 : ContentSettingTitleLinkAndCustomModel(delegate, tab_contents, profile, |
179 content_type), | 179 content_type), |
180 block_setting_(CONTENT_SETTING_BLOCK), | 180 block_setting_(CONTENT_SETTING_BLOCK), |
181 selected_item_(0) { | 181 selected_item_(0) { |
182 SetRadioGroup(); | 182 SetRadioGroup(); |
183 } | 183 } |
184 | 184 |
185 virtual ~ContentSettingSingleRadioGroup() { | 185 virtual ~ContentSettingSingleRadioGroup() { |
186 if (settings_changed()) { | 186 if (settings_changed()) { |
187 ContentSetting setting = | 187 ContentSetting setting = |
188 selected_item_ == 0 ? CONTENT_SETTING_ALLOW : block_setting_; | 188 selected_item_ == 0 ? CONTENT_SETTING_ALLOW : block_setting_; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 virtual void OnRadioClicked(int radio_index) { | 329 virtual void OnRadioClicked(int radio_index) { |
330 selected_item_ = radio_index; | 330 selected_item_ = radio_index; |
331 } | 331 } |
332 }; | 332 }; |
333 | 333 |
334 class ContentSettingCookiesBubbleModel : public ContentSettingSingleRadioGroup { | 334 class ContentSettingCookiesBubbleModel : public ContentSettingSingleRadioGroup { |
335 public: | 335 public: |
336 ContentSettingCookiesBubbleModel(Browser* browser, | 336 ContentSettingCookiesBubbleModel(Delegate* delegate, |
337 TabContentsWrapper* tab_contents, | 337 TabContentsWrapper* tab_contents, |
338 Profile* profile, | 338 Profile* profile, |
339 ContentSettingsType content_type) | 339 ContentSettingsType content_type) |
340 : ContentSettingSingleRadioGroup( | 340 : ContentSettingSingleRadioGroup( |
341 browser, tab_contents, profile, content_type) { | 341 delegate, tab_contents, profile, content_type) { |
342 DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); | 342 DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); |
343 set_custom_link_enabled(true); | 343 set_custom_link_enabled(true); |
344 } | 344 } |
345 | 345 |
346 virtual ~ContentSettingCookiesBubbleModel() { | 346 virtual ~ContentSettingCookiesBubbleModel() { |
347 if (settings_changed()) { | 347 if (settings_changed()) { |
348 InfoBarTabHelper* infobar_helper = tab_contents()->infobar_tab_helper(); | 348 InfoBarTabHelper* infobar_helper = tab_contents()->infobar_tab_helper(); |
349 infobar_helper->AddInfoBar( | 349 infobar_helper->AddInfoBar( |
350 new CollectedCookiesInfoBarDelegate(infobar_helper)); | 350 new CollectedCookiesInfoBarDelegate(infobar_helper)); |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 private: | 354 private: |
355 virtual void OnCustomLinkClicked() OVERRIDE { | 355 virtual void OnCustomLinkClicked() OVERRIDE { |
356 if (!tab_contents()) | 356 if (!tab_contents()) |
357 return; | 357 return; |
358 content::NotificationService::current()->Notify( | 358 content::NotificationService::current()->Notify( |
359 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, | 359 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
360 content::Source<TabSpecificContentSettings>( | 360 content::Source<TabSpecificContentSettings>( |
361 tab_contents()->content_settings()), | 361 tab_contents()->content_settings()), |
362 content::NotificationService::NoDetails()); | 362 content::NotificationService::NoDetails()); |
363 browser()->ShowCollectedCookiesDialog(tab_contents()); | 363 delegate()->ShowCollectedCookiesDialog(tab_contents()); |
364 } | 364 } |
365 }; | 365 }; |
366 | 366 |
367 class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { | 367 class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { |
368 public: | 368 public: |
369 ContentSettingPluginBubbleModel(Browser* browser, | 369 ContentSettingPluginBubbleModel(Delegate* delegate, |
370 TabContentsWrapper* tab_contents, | 370 TabContentsWrapper* tab_contents, |
371 Profile* profile, | 371 Profile* profile, |
372 ContentSettingsType content_type) | 372 ContentSettingsType content_type) |
373 : ContentSettingSingleRadioGroup( | 373 : ContentSettingSingleRadioGroup( |
374 browser, tab_contents, profile, content_type) { | 374 delegate, tab_contents, profile, content_type) { |
375 DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_PLUGINS); | 375 DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_PLUGINS); |
376 set_custom_link_enabled(tab_contents && tab_contents->content_settings()-> | 376 set_custom_link_enabled(tab_contents && tab_contents->content_settings()-> |
377 load_plugins_link_enabled()); | 377 load_plugins_link_enabled()); |
378 } | 378 } |
379 | 379 |
380 virtual ~ContentSettingPluginBubbleModel() {} | 380 virtual ~ContentSettingPluginBubbleModel() {} |
381 | 381 |
382 private: | 382 private: |
383 virtual void OnCustomLinkClicked() OVERRIDE { | 383 virtual void OnCustomLinkClicked() OVERRIDE { |
384 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); | 384 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); |
385 DCHECK(tab_contents()); | 385 DCHECK(tab_contents()); |
386 RenderViewHost* host = tab_contents()->web_contents()->GetRenderViewHost(); | 386 RenderViewHost* host = tab_contents()->web_contents()->GetRenderViewHost(); |
387 host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->routing_id())); | 387 host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->routing_id())); |
388 set_custom_link_enabled(false); | 388 set_custom_link_enabled(false); |
389 tab_contents()->content_settings()->set_load_plugins_link_enabled(false); | 389 tab_contents()->content_settings()->set_load_plugins_link_enabled(false); |
390 } | 390 } |
391 }; | 391 }; |
392 | 392 |
393 class ContentSettingPopupBubbleModel : public ContentSettingSingleRadioGroup { | 393 class ContentSettingPopupBubbleModel : public ContentSettingSingleRadioGroup { |
394 public: | 394 public: |
395 ContentSettingPopupBubbleModel(Browser* browser, | 395 ContentSettingPopupBubbleModel(Delegate* delegate, |
396 TabContentsWrapper* tab_contents, | 396 TabContentsWrapper* tab_contents, |
397 Profile* profile, | 397 Profile* profile, |
398 ContentSettingsType content_type) | 398 ContentSettingsType content_type) |
399 : ContentSettingSingleRadioGroup( | 399 : ContentSettingSingleRadioGroup( |
400 browser, tab_contents, profile, content_type) { | 400 delegate, tab_contents, profile, content_type) { |
401 SetPopups(); | 401 SetPopups(); |
402 } | 402 } |
403 | 403 |
404 virtual ~ContentSettingPopupBubbleModel() {} | 404 virtual ~ContentSettingPopupBubbleModel() {} |
405 | 405 |
406 private: | 406 private: |
407 void SetPopups() { | 407 void SetPopups() { |
408 std::vector<TabContentsWrapper*> blocked_contents; | 408 std::vector<TabContentsWrapper*> blocked_contents; |
409 tab_contents()->blocked_content_tab_helper()-> | 409 tab_contents()->blocked_content_tab_helper()-> |
410 GetBlockedContents(&blocked_contents); | 410 GetBlockedContents(&blocked_contents); |
(...skipping 16 matching lines...) Expand all Loading... |
427 if (tab_contents()) { | 427 if (tab_contents()) { |
428 tab_contents()->blocked_content_tab_helper()-> | 428 tab_contents()->blocked_content_tab_helper()-> |
429 LaunchForContents(bubble_content().popup_items[index].tab_contents); | 429 LaunchForContents(bubble_content().popup_items[index].tab_contents); |
430 } | 430 } |
431 } | 431 } |
432 }; | 432 }; |
433 | 433 |
434 class ContentSettingDomainListBubbleModel | 434 class ContentSettingDomainListBubbleModel |
435 : public ContentSettingTitleAndLinkModel { | 435 : public ContentSettingTitleAndLinkModel { |
436 public: | 436 public: |
437 ContentSettingDomainListBubbleModel(Browser* browser, | 437 ContentSettingDomainListBubbleModel(Delegate* delegate, |
438 TabContentsWrapper* tab_contents, | 438 TabContentsWrapper* tab_contents, |
439 Profile* profile, | 439 Profile* profile, |
440 ContentSettingsType content_type) | 440 ContentSettingsType content_type) |
441 : ContentSettingTitleAndLinkModel( | 441 : ContentSettingTitleAndLinkModel( |
442 browser, tab_contents, profile, content_type) { | 442 delegate, tab_contents, profile, content_type) { |
443 DCHECK_EQ(CONTENT_SETTINGS_TYPE_GEOLOCATION, content_type) << | 443 DCHECK_EQ(CONTENT_SETTINGS_TYPE_GEOLOCATION, content_type) << |
444 "SetDomains currently only supports geolocation content type"; | 444 "SetDomains currently only supports geolocation content type"; |
445 SetDomainsAndCustomLink(); | 445 SetDomainsAndCustomLink(); |
446 } | 446 } |
447 | 447 |
448 virtual ~ContentSettingDomainListBubbleModel() {} | 448 virtual ~ContentSettingDomainListBubbleModel() {} |
449 | 449 |
450 private: | 450 private: |
451 void MaybeAddDomainList(const std::set<std::string>& hosts, int title_id) { | 451 void MaybeAddDomainList(const std::set<std::string>& hosts, int title_id) { |
452 if (!hosts.empty()) { | 452 if (!hosts.empty()) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 503 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
504 std::string(), | 504 std::string(), |
505 CONTENT_SETTING_DEFAULT); | 505 CONTENT_SETTING_DEFAULT); |
506 } | 506 } |
507 } | 507 } |
508 }; | 508 }; |
509 | 509 |
510 // static | 510 // static |
511 ContentSettingBubbleModel* | 511 ContentSettingBubbleModel* |
512 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 512 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
513 Browser* browser, | 513 Delegate* delegate, |
514 TabContentsWrapper* tab_contents, | 514 TabContentsWrapper* tab_contents, |
515 Profile* profile, | 515 Profile* profile, |
516 ContentSettingsType content_type) { | 516 ContentSettingsType content_type) { |
517 if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { | 517 if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { |
518 return new ContentSettingCookiesBubbleModel(browser, tab_contents, profile, | 518 return new ContentSettingCookiesBubbleModel(delegate, tab_contents, profile, |
519 content_type); | 519 content_type); |
520 } | 520 } |
521 if (content_type == CONTENT_SETTINGS_TYPE_POPUPS) { | 521 if (content_type == CONTENT_SETTINGS_TYPE_POPUPS) { |
522 return new ContentSettingPopupBubbleModel(browser, tab_contents, profile, | 522 return new ContentSettingPopupBubbleModel(delegate, tab_contents, profile, |
523 content_type); | 523 content_type); |
524 } | 524 } |
525 if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { | 525 if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { |
526 return new ContentSettingDomainListBubbleModel(browser, tab_contents, | 526 return new ContentSettingDomainListBubbleModel(delegate, tab_contents, |
527 profile, content_type); | 527 profile, content_type); |
528 } | 528 } |
529 if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS) { | 529 if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS) { |
530 return new ContentSettingPluginBubbleModel(browser, tab_contents, profile, | 530 return new ContentSettingPluginBubbleModel(delegate, tab_contents, profile, |
531 content_type); | 531 content_type); |
532 } | 532 } |
533 return new ContentSettingSingleRadioGroup(browser, tab_contents, profile, | 533 return new ContentSettingSingleRadioGroup(delegate, tab_contents, profile, |
534 content_type); | 534 content_type); |
535 } | 535 } |
536 | 536 |
537 ContentSettingBubbleModel::ContentSettingBubbleModel( | 537 ContentSettingBubbleModel::ContentSettingBubbleModel( |
538 TabContentsWrapper* tab_contents, | 538 TabContentsWrapper* tab_contents, |
539 Profile* profile, | 539 Profile* profile, |
540 ContentSettingsType content_type) | 540 ContentSettingsType content_type) |
541 : tab_contents_(tab_contents), | 541 : tab_contents_(tab_contents), |
542 profile_(profile), | 542 profile_(profile), |
543 content_type_(content_type) { | 543 content_type_(content_type) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 tab_contents_ = NULL; | 582 tab_contents_ = NULL; |
583 break; | 583 break; |
584 case chrome::NOTIFICATION_PROFILE_DESTROYED: | 584 case chrome::NOTIFICATION_PROFILE_DESTROYED: |
585 DCHECK(source == content::Source<Profile>(profile_)); | 585 DCHECK(source == content::Source<Profile>(profile_)); |
586 profile_ = NULL; | 586 profile_ = NULL; |
587 break; | 587 break; |
588 default: | 588 default: |
589 NOTREACHED(); | 589 NOTREACHED(); |
590 } | 590 } |
591 } | 591 } |
OLD | NEW |