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/location_bar/zoom_bubble_view.h" | 5 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/chrome_page_zoom.h" | 10 #include "chrome/browser/chrome_page_zoom.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 void ZoomBubbleView::ButtonPressed(views::Button* sender, | 267 void ZoomBubbleView::ButtonPressed(views::Button* sender, |
268 const ui::Event& event) { | 268 const ui::Event& event) { |
269 if (sender == image_button_) { | 269 if (sender == image_button_) { |
270 DCHECK(extension_info_.icon_image) << "Invalid button press."; | 270 DCHECK(extension_info_.icon_image) << "Invalid button press."; |
271 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); | 271 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
272 chrome::AddSelectedTabWithURL( | 272 chrome::AddSelectedTabWithURL( |
273 browser, | 273 browser, |
274 GURL(base::StringPrintf("chrome://extensions?id=%s", | 274 GURL(base::StringPrintf("chrome://extensions?id=%s", |
275 extension_info_.id.c_str())), | 275 extension_info_.id.c_str())), |
276 content::PAGE_TRANSITION_FROM_API); | 276 ui::PAGE_TRANSITION_FROM_API); |
277 } else { | 277 } else { |
278 chrome_page_zoom::Zoom(web_contents_, content::PAGE_ZOOM_RESET); | 278 chrome_page_zoom::Zoom(web_contents_, content::PAGE_ZOOM_RESET); |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 void ZoomBubbleView::Init() { | 282 void ZoomBubbleView::Init() { |
283 // Set up the layout of the zoom bubble. A grid layout is used because | 283 // Set up the layout of the zoom bubble. A grid layout is used because |
284 // sometimes an extension icon is shown next to the zoom label. | 284 // sometimes an extension icon is shown next to the zoom label. |
285 views::GridLayout* grid_layout = new views::GridLayout(this); | 285 views::GridLayout* grid_layout = new views::GridLayout(this); |
286 SetLayoutManager(grid_layout); | 286 SetLayoutManager(grid_layout); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 void ZoomBubbleView::WindowClosing() { | 352 void ZoomBubbleView::WindowClosing() { |
353 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't | 353 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't |
354 // call this right away). Only set to NULL when it's this bubble. | 354 // call this right away). Only set to NULL when it's this bubble. |
355 if (zoom_bubble_ == this) | 355 if (zoom_bubble_ == this) |
356 zoom_bubble_ = NULL; | 356 zoom_bubble_ = NULL; |
357 } | 357 } |
358 | 358 |
359 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} | 359 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} |
360 | 360 |
361 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} | 361 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} |
OLD | NEW |