Chromium Code Reviews| 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/web_intents_button_view.h" | 5 #include "chrome/browser/ui/views/location_bar/web_intents_button_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 7 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 !tab_contents->web_intent_picker_controller()-> | 27 !tab_contents->web_intent_picker_controller()-> |
| 28 ShowLocationBarPickerTool()) { | 28 ShowLocationBarPickerTool()) { |
| 29 SetVisible(false); | 29 SetVisible(false); |
| 30 } else { | 30 } else { |
| 31 SetVisible(true); | 31 SetVisible(true); |
| 32 } | 32 } |
| 33 | 33 |
| 34 int animated_string_id = IDS_INTENT_PICKER_USE_ANOTHER_SERVICE; | 34 int animated_string_id = IDS_INTENT_PICKER_USE_ANOTHER_SERVICE; |
| 35 string16 animated_text = l10n_util::GetStringUTF16(animated_string_id); | 35 string16 animated_text = l10n_util::GetStringUTF16(animated_string_id); |
| 36 SetTooltipText(animated_text); | 36 SetTooltipText(animated_text); |
| 37 PreferredSizeChanged(); | |
| 37 | 38 |
| 39 AlwaysDrawText(); | |
|
Peter Kasting
2012/09/15 00:23:46
Nit: If the order of these statements matters, wri
Greg Billock
2012/09/15 04:58:20
It shouldn't, but belongs this way. I'll add a com
| |
| 38 StartLabelAnimation(animated_text, kMoveTimeMs); | 40 StartLabelAnimation(animated_text, kMoveTimeMs); |
| 39 AlwaysDrawText(); | |
| 40 } | 41 } |
| 41 | 42 |
| 42 void WebIntentsButtonView::OnClick(LocationBarView* parent) { | 43 void WebIntentsButtonView::OnClick(LocationBarView* parent) { |
| 43 TabContents* tab_contents = parent->GetTabContents(); | 44 TabContents* tab_contents = parent->GetTabContents(); |
| 44 if (!tab_contents) | 45 if (!tab_contents) |
| 45 return; | 46 return; |
| 46 | 47 |
| 47 tab_contents->web_intent_picker_controller()->LocationBarPickerToolClicked(); | 48 tab_contents->web_intent_picker_controller()->LocationBarPickerToolClicked(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 int WebIntentsButtonView::GetTextAnimationSize(double state, int text_size) { | 51 int WebIntentsButtonView::GetTextAnimationSize(double state, int text_size) { |
| 51 if (state < 1.0) { | 52 if (state < 1.0) { |
| 52 return static_cast<int>(text_size * state); | 53 return static_cast<int>(text_size * state); |
| 53 } | 54 } |
| 54 | 55 |
| 55 return text_size; | 56 return text_size; |
| 56 } | 57 } |
| OLD | NEW |