Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4052)

Unified Diff: chrome/views/native_button.cc

Issue 6043: Added dangerous download prompting. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/views/native_button.cc
===================================================================
--- chrome/views/native_button.cc (revision 2758)
+++ chrome/views/native_button.cc (working copy)
@@ -5,17 +5,20 @@
#include "chrome/views/native_button.h"
#include "base/logging.h"
+#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/background.h"
namespace ChromeViews {
-NativeButton::NativeButton(const std::wstring& label) {
+NativeButton::NativeButton(const std::wstring& label)
+ : enforce_dlu_min_size_(true) {
Init(label, false);
}
-NativeButton::NativeButton(const std::wstring& label, bool is_default) {
+NativeButton::NativeButton(const std::wstring& label, bool is_default)
+ : enforce_dlu_min_size_(true) {
Init(label, is_default);
}
@@ -41,13 +44,16 @@
sz.cx += 2 * padding_.cx;
sz.cy += 2 * padding_.cy;
- if (min_dlu_size_.width())
- sz.cx = std::max(static_cast<int>(sz.cx),
- font_.horizontal_dlus_to_pixels(min_dlu_size_.width()));
- if (min_dlu_size_.height())
- sz.cy = std::max(static_cast<int>(sz.cy),
- font_.vertical_dlus_to_pixels(min_dlu_size_.height()));
-
+ if (enforce_dlu_min_size_) {
+ if (min_dlu_size_.width()) {
+ sz.cx =
+ std::max(static_cast<int>(sz.cx),
+ font_.horizontal_dlus_to_pixels(min_dlu_size_.width()));
+ }
+ if (min_dlu_size_.height())
+ sz.cy = std::max(static_cast<int>(sz.cy),
+ font_.vertical_dlus_to_pixels(min_dlu_size_.height()));
+ }
*out = sz;
}
}
@@ -186,4 +192,3 @@
}
}
-
« chrome/browser/download/download_manager.cc ('K') | « chrome/views/native_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698