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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_view.cc

Issue 10792020: Implements the "Set to default" button on the zoom bubble. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed .gitmodules, oops Created 8 years, 4 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/browser/ui/views/location_bar/zoom_view.cc
diff --git a/chrome/browser/ui/views/location_bar/zoom_view.cc b/chrome/browser/ui/views/location_bar/zoom_view.cc
index 7912f89e7a1e21e593c290e50813310fcde3ffed..c99d649848bbc26ae0b6892e67a998882962efaa 100644
--- a/chrome/browser/ui/views/location_bar/zoom_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_view.cc
@@ -14,8 +14,10 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/size.h"
-ZoomView::ZoomView(ToolbarModel* toolbar_model)
+ZoomView::ZoomView(ToolbarModel* toolbar_model,
+ LocationBarView::Delegate* location_bar_delegate)
: toolbar_model_(toolbar_model),
+ location_bar_delegate_(location_bar_delegate),
zoom_icon_state_(ZoomController::NONE),
zoom_percent_(100) {
set_accessibility_focusable(true);
@@ -71,8 +73,10 @@ bool ZoomView::OnMousePressed(const views::MouseEvent& event) {
}
void ZoomView::OnMouseReleased(const views::MouseEvent& event) {
- if (event.IsOnlyLeftMouseButton() && HitTest(event.location()))
- ZoomBubbleView::ShowBubble(this, zoom_percent_, false);
+ if (event.IsOnlyLeftMouseButton() && HitTest(event.location())) {
+ ZoomBubbleView::ShowBubble(
+ this, location_bar_delegate_->GetTabContents(), false);
+ }
}
bool ZoomView::OnKeyPressed(const views::KeyEvent& event) {
@@ -80,6 +84,7 @@ bool ZoomView::OnKeyPressed(const views::KeyEvent& event) {
event.key_code() != ui::VKEY_RETURN)
return false;
- ZoomBubbleView::ShowBubble(this, zoom_percent_, false);
+ ZoomBubbleView::ShowBubble(
+ this, location_bar_delegate_->GetTabContents(), false);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698