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

Unified Diff: chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc

Issue 10885024: Integrate Chrome To Mobile with Action Box UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nil/NULL checks in ChromeToMobileBubbleController. 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
« no previous file with comments | « chrome/browser/ui/view_ids.h ('k') | chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
diff --git a/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc b/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
index 52aebb7d694ca49384d8d4c8093c854ef02c34b8..9755133f2efa2a401ec5e800075ed0f1cae415b9 100644
--- a/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
+++ b/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
@@ -25,7 +25,6 @@
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/button/radio_button.h"
#include "ui/views/controls/button/text_button.h"
-#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/link.h"
#include "ui/views/layout/grid_layout.h"
@@ -69,10 +68,10 @@ void CheckboxNativeThemeBorder::GetInsets(gfx::Insets* insets) const {
insets->Set(insets->top(), 0, insets->bottom(), insets->right());
}
-// Downcast the View to an ImageView and set the image with the resource |id|.
-void SetImageViewToId(views::View* image_view, int id) {
- static_cast<views::ImageView*>(image_view)->
- SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(id));
+// Downcast TextButton |view| and set the icon image with the resource |id|.
+void SetTextButtonIconToId(views::View* view, int id) {
+ static_cast<views::TextButton*>(view)->
+ SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(id));
}
} // namespace
@@ -108,7 +107,7 @@ void ChromeToMobileBubbleView::ShowBubble(views::View* anchor_view,
return;
// Show the lit mobile device icon during the bubble's lifetime.
- SetImageViewToId(anchor_view, IDR_MOBILE_LIT);
+ SetTextButtonIconToId(anchor_view, IDR_MOBILE_LIT);
bubble_ = new ChromeToMobileBubbleView(anchor_view, browser);
views::BubbleDelegateView::CreateBubble(bubble_);
bubble_->Show();
@@ -137,8 +136,8 @@ void ChromeToMobileBubbleView::WindowClosing() {
// Instruct the service to delete the snapshot file.
service_->DeleteSnapshot(snapshot_path_);
- // Restore the resting state mobile device icon.
- SetImageViewToId(anchor_view(), IDR_MOBILE);
+ // Restore the resting state action box icon.
+ SetTextButtonIconToId(anchor_view(), IDR_ACTION_BOX_BUTTON);
}
bool ChromeToMobileBubbleView::AcceleratorPressed(
« no previous file with comments | « chrome/browser/ui/view_ids.h ('k') | chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698