Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / ui / browser_content_setting_bubble_model_delegate.cc
blob1870fb1628541086df8197446b37bfe1c2472714
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h"
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_dialogs.h"
9 #include "chrome/browser/ui/browser_tabstrip.h"
10 #include "chrome/browser/ui/chrome_pages.h"
11 #include "chrome/common/url_constants.h"
12 #include "components/google/core/browser/google_util.h"
14 // The URL for when the user clicks "learn more" on the mixed scripting page
15 // icon bubble.
16 const char kInsecureScriptHelpUrl[] =
17 "https://support.google.com/chrome/bin/answer.py?answer=1342714";
19 BrowserContentSettingBubbleModelDelegate::
20 BrowserContentSettingBubbleModelDelegate(Browser* browser) : browser_(browser) {
23 BrowserContentSettingBubbleModelDelegate::
24 ~BrowserContentSettingBubbleModelDelegate() {
27 void BrowserContentSettingBubbleModelDelegate::ShowCollectedCookiesDialog(
28 content::WebContents* web_contents) {
29 chrome::ShowCollectedCookiesDialog(web_contents);
32 void BrowserContentSettingBubbleModelDelegate::ShowContentSettingsPage(
33 ContentSettingsType type) {
34 switch (type) {
35 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT:
36 // We don't (yet?) implement user-settable exceptions for mixed script
37 // blocking, so bounce to an explanatory page for now.
38 chrome::AddSelectedTabWithURL(browser_,
39 GURL(kInsecureScriptHelpUrl),
40 ui::PAGE_TRANSITION_LINK);
41 return;
42 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS:
43 chrome::ShowSettingsSubPage(browser_, chrome::kHandlerSettingsSubPage);
44 return;
45 default:
46 chrome::ShowContentSettings(browser_, type);
47 return;
51 void BrowserContentSettingBubbleModelDelegate::ShowLearnMorePage(
52 ContentSettingsType type) {
53 if (type != CONTENT_SETTINGS_TYPE_PLUGINS)
54 return;
55 chrome::AddSelectedTabWithURL(browser_,
56 GURL(chrome::kBlockedPluginLearnMoreURL),
57 ui::PAGE_TRANSITION_LINK);