| 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/browser_content_setting_bubble_model_delegate.h" |   5 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 
|   6  |   6  | 
|   7 #include "chrome/browser/google/google_util.h" |   7 #include "chrome/browser/google/google_util.h" | 
|   8 #include "chrome/browser/ui/browser.h" |   8 #include "chrome/browser/ui/browser.h" | 
|   9 #include "chrome/browser/ui/browser_dialogs.h" |   9 #include "chrome/browser/ui/browser_dialogs.h" | 
|  10 #include "chrome/browser/ui/browser_tabstrip.h" |  10 #include "chrome/browser/ui/browser_tabstrip.h" | 
|  11 #include "chrome/browser/ui/chrome_pages.h" |  11 #include "chrome/browser/ui/chrome_pages.h" | 
 |  12 #include "chrome/common/url_constants.h" | 
|  12  |  13  | 
|  13 // The URL for when the user clicks "learn more" on the mixed scripting page |  14 // The URL for when the user clicks "learn more" on the mixed scripting page | 
|  14 // icon bubble. |  15 // icon bubble. | 
|  15 const char kInsecureScriptHelpUrl[] = |  16 const char kInsecureScriptHelpUrl[] = | 
|  16     "https://support.google.com/chrome/bin/answer.py?answer=1342714"; |  17     "https://support.google.com/chrome/bin/answer.py?answer=1342714"; | 
|  17  |  18  | 
|  18 BrowserContentSettingBubbleModelDelegate:: |  19 BrowserContentSettingBubbleModelDelegate:: | 
|  19 BrowserContentSettingBubbleModelDelegate(Browser* browser) : browser_(browser) { |  20 BrowserContentSettingBubbleModelDelegate(Browser* browser) : browser_(browser) { | 
|  20 } |  21 } | 
|  21  |  22  | 
|  22 BrowserContentSettingBubbleModelDelegate:: |  23 BrowserContentSettingBubbleModelDelegate:: | 
|  23 ~BrowserContentSettingBubbleModelDelegate() { |  24 ~BrowserContentSettingBubbleModelDelegate() { | 
|  24 } |  25 } | 
|  25  |  26  | 
|  26 void BrowserContentSettingBubbleModelDelegate::ShowCollectedCookiesDialog( |  27 void BrowserContentSettingBubbleModelDelegate::ShowCollectedCookiesDialog( | 
|  27     TabContents* contents) { |  28     TabContents* contents) { | 
|  28   chrome::ShowCollectedCookiesDialog(contents); |  29   chrome::ShowCollectedCookiesDialog(contents); | 
|  29 } |  30 } | 
|  30  |  31  | 
|  31 void BrowserContentSettingBubbleModelDelegate::ShowContentSettingsPage( |  32 void BrowserContentSettingBubbleModelDelegate::ShowContentSettingsPage( | 
|  32     ContentSettingsType type) { |  33     ContentSettingsType type) { | 
|  33   if (type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { |  34   if (type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { | 
|  34     // We don't (yet?) implement user-settable exceptions for mixed script |  35     // We don't (yet?) implement user-settable exceptions for mixed script | 
|  35     // blocking, so bounce to an explanatory page for now. |  36     // blocking, so bounce to an explanatory page for now. | 
|  36     GURL url(google_util::AppendGoogleLocaleParam( |  37     GURL url(google_util::AppendGoogleLocaleParam( | 
|  37         GURL(kInsecureScriptHelpUrl))); |  38         GURL(kInsecureScriptHelpUrl))); | 
|  38     chrome::AddSelectedTabWithURL(browser_, url, content::PAGE_TRANSITION_LINK); |  39     chrome::AddSelectedTabWithURL(browser_, url, content::PAGE_TRANSITION_LINK); | 
|  39   } else { |  40     return; | 
|  40     chrome::ShowContentSettings(browser_, type); |  | 
|  41   } |  41   } | 
 |  42  | 
 |  43   if (type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) { | 
 |  44     chrome::ShowSettingsSubPage(browser_, chrome::kHandlerSettingsSubPage); | 
 |  45     return; | 
 |  46   } | 
 |  47  | 
 |  48   chrome::ShowContentSettings(browser_, type); | 
|  42 } |  49 } | 
| OLD | NEW |