summaryrefslogtreecommitdiffstats
path: root/views/controls/button/native_button_win.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 07:09:30 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 07:09:30 +0000
commit2891839ea6e7748abba4c7b822b68342dc84cec2 (patch)
tree319dd7e421e3707cb8196a14a0ad17ec1df1d3ac /views/controls/button/native_button_win.cc
parent2e3b520ff4318342b027ea8aa303e5981ea9ce79 (diff)
downloadchromium_src-2891839ea6e7748abba4c7b822b68342dc84cec2.zip
chromium_src-2891839ea6e7748abba4c7b822b68342dc84cec2.tar.gz
chromium_src-2891839ea6e7748abba4c7b822b68342dc84cec2.tar.bz2
This change adds shield icons to the buttons that need elevation to fix Issue 29631. This change adds a bool flag |need_elevation_| to notify when a button needs elevation to the NativeButton class and add shield icons to the following buttons.
- on the "Start Chromium" button on the first-run dialog when the "Make Chromium the default browser" checkbox is enabled. - on the "Set as Default" button on the default browser infobar. - on the "Make Google Chrome my default browser" button on the Basics tab of options. BUG=29631 TEST=Launch Chrome when it is not set as a default browser and see the "Set as Default" button has a shield icon. TEST=Launch Chrome when it is not set as a default browser and open the "Options" dialog, and see its "Make Google Chrome my default browser" button has a shield icon. TEST=Launch Chrome with a '--first-run' option when it is not set as a default browser, and see its "Launch Chrome" button has a shield icon. Review URL: http://codereview.chromium.org/661165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button/native_button_win.cc')
-rw-r--r--views/controls/button/native_button_win.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/views/controls/button/native_button_win.cc b/views/controls/button/native_button_win.cc
index d138833..57be88c 100644
--- a/views/controls/button/native_button_win.cc
+++ b/views/controls/button/native_button_win.cc
@@ -1,12 +1,13 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#include "views/controls/button/native_button_win.h"
#include <commctrl.h>
#include "base/logging.h"
+#include "base/win_util.h"
#include "views/controls/button/checkbox.h"
#include "views/controls/button/native_button.h"
#include "views/controls/button/radio_button.h"
@@ -32,6 +33,14 @@ NativeButtonWin::~NativeButtonWin() {
// NativeButtonWin, NativeButtonWrapper implementation:
void NativeButtonWin::UpdateLabel() {
+ // Show or hide the shield icon of Windows onto this button every time when we
+ // update the button text so Windows can lay out the shield icon and the
+ // button text correctly.
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) {
+ Button_SetElevationRequiredState(native_view(),
+ native_button_->need_elevation());
+ }
+
SetWindowText(native_view(), native_button_->label().c_str());
}