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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/accessibility/invert_bubble_views.h" | 6 #include "chrome/browser/accessibility/invert_bubble_views.h" |
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/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 WindowOpenDisposition disposition = | 148 WindowOpenDisposition disposition = |
149 event_utils::DispositionFromEventFlags(event_flags); | 149 event_utils::DispositionFromEventFlags(event_flags); |
150 content::OpenURLParams params( | 150 content::OpenURLParams params( |
151 GURL(url), content::Referrer(), | 151 GURL(url), content::Referrer(), |
152 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, | 152 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, |
153 content::PAGE_TRANSITION_LINK, false); | 153 content::PAGE_TRANSITION_LINK, false); |
154 browser->OpenURL(params); | 154 browser->OpenURL(params); |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 // static | |
159 void InvertBubble::RegisterUserPrefs(PrefService* prefs) { | |
160 prefs->RegisterBooleanPref(prefs::kInvertNotificationShown, | |
161 false, | |
162 PrefService::UNSYNCABLE_PREF); | |
163 } | |
164 | |
165 void InvertBubble::MaybeShowInvertBubble(Profile* profile, | 158 void InvertBubble::MaybeShowInvertBubble(Profile* profile, |
166 views::View* anchor_view) { | 159 views::View* anchor_view) { |
167 PrefService* pref_service = profile->GetPrefs(); | 160 PrefService* pref_service = profile->GetPrefs(); |
168 if (gfx::IsInvertedColorScheme() && | 161 if (gfx::IsInvertedColorScheme() && |
169 !pref_service->GetBoolean(prefs::kInvertNotificationShown)) { | 162 !pref_service->GetBoolean(prefs::kInvertNotificationShown)) { |
170 pref_service->SetBoolean(prefs::kInvertNotificationShown, true); | 163 pref_service->SetBoolean(prefs::kInvertNotificationShown, true); |
171 InvertBubbleView* delegate = new InvertBubbleView(profile, anchor_view); | 164 InvertBubbleView* delegate = new InvertBubbleView(profile, anchor_view); |
172 views::BubbleDelegateView::CreateBubble(delegate); | 165 views::BubbleDelegateView::CreateBubble(delegate); |
173 delegate->StartFade(true); | 166 delegate->StartFade(true); |
174 } | 167 } |
175 } | 168 } |
OLD | NEW |