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

Side by Side Diff: chrome/browser/ui/views/location_bar/web_intents_button_view.cc

Issue 10917280: Fix up views web intents location bar decoration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698