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/views/network_profile_bubble_view.h" | 5 #include "chrome/browser/ui/views/network_profile_bubble_view.h" |
6 | 6 |
7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/network_profile_bubble.h" | 10 #include "chrome/browser/ui/network_profile_bubble.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 NetworkProfileBubble::METRIC_ACKNOWLEDGED); | 116 NetworkProfileBubble::METRIC_ACKNOWLEDGED); |
117 | 117 |
118 GetWidget()->Close(); | 118 GetWidget()->Close(); |
119 } | 119 } |
120 | 120 |
121 void NetworkProfileBubbleView::LinkClicked(views::Link* source, | 121 void NetworkProfileBubbleView::LinkClicked(views::Link* source, |
122 int event_flags) { | 122 int event_flags) { |
123 NetworkProfileBubble::RecordUmaEvent( | 123 NetworkProfileBubble::RecordUmaEvent( |
124 NetworkProfileBubble::METRIC_LEARN_MORE_CLICKED); | 124 NetworkProfileBubble::METRIC_LEARN_MORE_CLICKED); |
125 WindowOpenDisposition disposition = | 125 WindowOpenDisposition disposition = |
126 chrome::DispositionFromEventFlags(event_flags); | 126 ui::DispositionFromEventFlags(event_flags); |
127 content::OpenURLParams params( | 127 content::OpenURLParams params( |
128 GURL("https://sites.google.com/a/chromium.org/dev/administrators/" | 128 GURL("https://sites.google.com/a/chromium.org/dev/administrators/" |
129 "common-problems-and-solutions#network_profile"), | 129 "common-problems-and-solutions#network_profile"), |
130 content::Referrer(), | 130 content::Referrer(), |
131 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, | 131 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, |
132 content::PAGE_TRANSITION_LINK, false); | 132 content::PAGE_TRANSITION_LINK, false); |
133 navigator_->OpenURL(params); | 133 navigator_->OpenURL(params); |
134 | 134 |
135 // If the user interacted with the bubble we don't reduce the number of | 135 // If the user interacted with the bubble we don't reduce the number of |
136 // warnings left. | 136 // warnings left. |
137 PrefService* prefs = profile_->GetPrefs(); | 137 PrefService* prefs = profile_->GetPrefs(); |
138 int left_warnings = prefs->GetInteger(prefs::kNetworkProfileWarningsLeft); | 138 int left_warnings = prefs->GetInteger(prefs::kNetworkProfileWarningsLeft); |
139 prefs->SetInteger(prefs::kNetworkProfileWarningsLeft, ++left_warnings); | 139 prefs->SetInteger(prefs::kNetworkProfileWarningsLeft, ++left_warnings); |
140 GetWidget()->Close(); | 140 GetWidget()->Close(); |
141 } | 141 } |
OLD | NEW |