| 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/accessibility/invert_bubble_view.h" | 5 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/event_disposition.h" | 7 #include "chrome/browser/event_disposition.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 else if (source == learn_more_) | 137 else if (source == learn_more_) |
| 138 OpenLink(kLearnMoreUrl, event_flags); | 138 OpenLink(kLearnMoreUrl, event_flags); |
| 139 else if (source == close_) | 139 else if (source == close_) |
| 140 GetWidget()->Close(); | 140 GetWidget()->Close(); |
| 141 else | 141 else |
| 142 NOTREACHED(); | 142 NOTREACHED(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void InvertBubbleView::OpenLink(const std::string& url, int event_flags) { | 145 void InvertBubbleView::OpenLink(const std::string& url, int event_flags) { |
| 146 WindowOpenDisposition disposition = | 146 WindowOpenDisposition disposition = |
| 147 browser::DispositionFromEventFlags(event_flags); | 147 chrome::DispositionFromEventFlags(event_flags); |
| 148 content::OpenURLParams params( | 148 content::OpenURLParams params( |
| 149 GURL(url), content::Referrer(), | 149 GURL(url), content::Referrer(), |
| 150 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, | 150 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, |
| 151 content::PAGE_TRANSITION_LINK, false); | 151 content::PAGE_TRANSITION_LINK, false); |
| 152 browser_->OpenURL(params); | 152 browser_->OpenURL(params); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace | 155 } // namespace |
| 156 | 156 |
| 157 namespace browser { | 157 namespace browser { |
| 158 | 158 |
| 159 void MaybeShowInvertBubbleView(Browser* browser, views::View* anchor_view) { | 159 void MaybeShowInvertBubbleView(Browser* browser, views::View* anchor_view) { |
| 160 PrefService* pref_service = browser->profile()->GetPrefs(); | 160 PrefService* pref_service = browser->profile()->GetPrefs(); |
| 161 if (gfx::IsInvertedColorScheme() && | 161 if (gfx::IsInvertedColorScheme() && |
| 162 !pref_service->GetBoolean(prefs::kInvertNotificationShown)) { | 162 !pref_service->GetBoolean(prefs::kInvertNotificationShown)) { |
| 163 pref_service->SetBoolean(prefs::kInvertNotificationShown, true); | 163 pref_service->SetBoolean(prefs::kInvertNotificationShown, true); |
| 164 InvertBubbleView* delegate = new InvertBubbleView(browser, anchor_view); | 164 InvertBubbleView* delegate = new InvertBubbleView(browser, anchor_view); |
| 165 views::BubbleDelegateView::CreateBubble(delegate); | 165 views::BubbleDelegateView::CreateBubble(delegate); |
| 166 delegate->StartFade(true); | 166 delegate->StartFade(true); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace browser | 170 } // namespace browser |
| OLD | NEW |