| 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/infobars/infobar_view.h" | 5 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 text_button->set_animate_on_state_change(false); | 123 text_button->set_animate_on_state_change(false); |
| 124 text_button->SetEnabledColor(SK_ColorBLACK); | 124 text_button->SetEnabledColor(SK_ColorBLACK); |
| 125 text_button->SetHighlightColor(SK_ColorBLACK); | 125 text_button->SetHighlightColor(SK_ColorBLACK); |
| 126 text_button->SetHoverColor(SK_ColorBLACK); | 126 text_button->SetHoverColor(SK_ColorBLACK); |
| 127 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 127 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 128 text_button->SetFont(rb.GetFont(ui::ResourceBundle::MediumFont)); | 128 text_button->SetFont(rb.GetFont(ui::ResourceBundle::MediumFont)); |
| 129 #if defined(OS_WIN) | 129 #if defined(OS_WIN) |
| 130 if (needs_elevation && | 130 if (needs_elevation && |
| 131 (base::win::GetVersion() >= base::win::VERSION_VISTA) && | 131 (base::win::GetVersion() >= base::win::VERSION_VISTA) && |
| 132 base::win::UserAccountControlIsEnabled()) { | 132 base::win::UserAccountControlIsEnabled()) { |
| 133 SHSTOCKICONINFO icon_info = { sizeof SHSTOCKICONINFO }; | 133 SHSTOCKICONINFO icon_info = { sizeof(SHSTOCKICONINFO) }; |
| 134 // Even with the runtime guard above, we have to use GetProcAddress() here, | 134 // Even with the runtime guard above, we have to use GetProcAddress() here, |
| 135 // because otherwise the loader will try to resolve the function address on | 135 // because otherwise the loader will try to resolve the function address on |
| 136 // startup, which will break on XP. | 136 // startup, which will break on XP. |
| 137 typedef HRESULT (STDAPICALLTYPE *GetStockIconInfo)(SHSTOCKICONID, UINT, | 137 typedef HRESULT (STDAPICALLTYPE *GetStockIconInfo)(SHSTOCKICONID, UINT, |
| 138 SHSTOCKICONINFO*); | 138 SHSTOCKICONINFO*); |
| 139 GetStockIconInfo func = reinterpret_cast<GetStockIconInfo>( | 139 GetStockIconInfo func = reinterpret_cast<GetStockIconInfo>( |
| 140 GetProcAddress(GetModuleHandle(L"shell32.dll"), "SHGetStockIconInfo")); | 140 GetProcAddress(GetModuleHandle(L"shell32.dll"), "SHGetStockIconInfo")); |
| 141 if (SUCCEEDED((*func)(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, | 141 if (SUCCEEDED((*func)(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, |
| 142 &icon_info))) { | 142 &icon_info))) { |
| 143 scoped_ptr<SkBitmap> icon(IconUtil::CreateSkBitmapFromHICON( | 143 scoped_ptr<SkBitmap> icon(IconUtil::CreateSkBitmapFromHICON( |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // infobar. | 375 // infobar. |
| 376 if (focused_before && focused_now && !Contains(focused_before) && | 376 if (focused_before && focused_now && !Contains(focused_before) && |
| 377 Contains(focused_now) && GetWidget()) { | 377 Contains(focused_now) && GetWidget()) { |
| 378 GetWidget()->NotifyAccessibilityEvent( | 378 GetWidget()->NotifyAccessibilityEvent( |
| 379 this, ui::AccessibilityTypes::EVENT_ALERT, true); | 379 this, ui::AccessibilityTypes::EVENT_ALERT, true); |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { | 383 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { |
| 384 } | 384 } |
| OLD | NEW |