diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/theme/chromium/chromium_icon_32.png | bin | 0 -> 2750 bytes | |||
-rw-r--r-- | chrome/app/theme/theme_resources.grd | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/infobar_delegate.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/infobars/infobars.cc | 2 | ||||
-rw-r--r-- | chrome/views/controls/button/native_button.cc | 8 | ||||
-rw-r--r-- | chrome/views/controls/button/native_button.h | 9 |
6 files changed, 20 insertions, 7 deletions
diff --git a/chrome/app/theme/chromium/chromium_icon_32.png b/chrome/app/theme/chromium/chromium_icon_32.png Binary files differnew file mode 100644 index 0000000..e804e3f --- /dev/null +++ b/chrome/app/theme/chromium/chromium_icon_32.png diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 0b07be3..7d70b99 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd @@ -346,6 +346,7 @@ <include name="IDR_PRODUCT_LOGO_16" file="google_chrome/product_logo_16.png" type="BINDATA" /> <include name="IDR_WIZARD_ICON" file="google_chrome/wizard_icon.png" type="BINDATA" /> <include name="IDR_WIZARD_ICON_RTL" file="google_chrome/wizard_icon_rtl.png" type="BINDATA" /> + <include name="IDR_PRODUCT_ICON_32" file="google_chrome/google_chrome_icon_32.png" type="BINDATA" /> </if> <if expr="not pp_ifdef('_google_chrome')"> @@ -356,6 +357,7 @@ <include name="IDR_PRODUCT_LOGO_16" file="chromium/product_logo_16.png" type="BINDATA" /> <include name="IDR_WIZARD_ICON" file="chromium/wizard_icon.png" type="BINDATA" /> <include name="IDR_WIZARD_ICON_RTL" file="chromium/wizard_icon_rtl.png" type="BINDATA" /> + <include name="IDR_PRODUCT_ICON_32" file="chromium/chromium_icon_32.png" type="BINDATA" /> </if> </includes> </release> diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 3f6cfdb..25db94d 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -172,8 +172,10 @@ class ConfirmInfoBarDelegate : public AlertInfoBarDelegate { public: enum InfoBarButton { BUTTON_NONE = 0, - BUTTON_OK, - BUTTON_CANCEL + BUTTON_OK = 1, + BUTTON_CANCEL = 2, + // Specifies that the OK button should be rendered like a default button. + BUTTON_OK_DEFAULT = 4 }; // Return the buttons to be shown for this InfoBar. diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index 63916bb..66a95c4 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -374,6 +374,8 @@ ConfirmInfoBar::ConfirmInfoBar(ConfirmInfoBarDelegate* delegate) AlertInfoBar(delegate) { ok_button_ = new views::NativeButton( this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK)); + if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_OK_DEFAULT) + ok_button_->SetAppearsAsDefault(true); cancel_button_ = new views::NativeButton( this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL)); } diff --git a/chrome/views/controls/button/native_button.cc b/chrome/views/controls/button/native_button.cc index a13ab14..e5c1850 100644 --- a/chrome/views/controls/button/native_button.cc +++ b/chrome/views/controls/button/native_button.cc @@ -69,13 +69,15 @@ void NativeButton::SetLabel(const std::wstring& label) { void NativeButton::SetIsDefault(bool is_default) { if (is_default == is_default_) return; - is_default_ = is_default; - - if (is_default_) + if (is_default) AddAccelerator(Accelerator(VK_RETURN, false, false, false)); else RemoveAccelerator(Accelerator(VK_RETURN, false, false, false)); + SetAppearsAsDefault(is_default); +} +void NativeButton::SetAppearsAsDefault(bool appears_as_default) { + is_default_ = appears_as_default; if (native_wrapper_) native_wrapper_->UpdateDefault(); } diff --git a/chrome/views/controls/button/native_button.h b/chrome/views/controls/button/native_button.h index e86e80c..e7293c2 100644 --- a/chrome/views/controls/button/native_button.h +++ b/chrome/views/controls/button/native_button.h @@ -30,11 +30,16 @@ class NativeButton : public Button { void set_font(const ChromeFont& font) { font_ = font; } const ChromeFont& font() const { return font_; } - // Sets/Gets whether or not the button appears as the default button in its - // current context. + // Sets/Gets whether or not the button appears and behaves as the default + // button in its current context. void SetIsDefault(bool default_button); bool is_default() const { return is_default_; } + // Sets whether or not the button appears as the default button. This does + // not make it behave as the default (i.e. no enter key accelerator is + // registered, use SetIsDefault for that). + void SetAppearsAsDefault(bool default_button); + void set_minimum_size(const gfx::Size& minimum_size) { minimum_size_ = minimum_size; } |