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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.h

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add the browser test Created 7 years, 2 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
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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class KeywordHintView; 44 class KeywordHintView;
45 class LocationIconView; 45 class LocationIconView;
46 class OpenPDFInReaderView; 46 class OpenPDFInReaderView;
47 class PageActionWithBadgeView; 47 class PageActionWithBadgeView;
48 class PageActionImageView; 48 class PageActionImageView;
49 class Profile; 49 class Profile;
50 class ScriptBubbleIconView; 50 class ScriptBubbleIconView;
51 class SelectedKeywordView; 51 class SelectedKeywordView;
52 class StarView; 52 class StarView;
53 class TemplateURLService; 53 class TemplateURLService;
54 class TranslateIconView;
54 class ZoomView; 55 class ZoomView;
55 56
56 namespace views { 57 namespace views {
57 class BubbleDelegateView; 58 class BubbleDelegateView;
58 class ImageButton; 59 class ImageButton;
59 class Label; 60 class Label;
60 class Widget; 61 class Widget;
61 } 62 }
62 63
63 ///////////////////////////////////////////////////////////////////////////// 64 /////////////////////////////////////////////////////////////////////////////
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 179
179 // Retrieves the PageAction View which is associated with |page_action|. 180 // Retrieves the PageAction View which is associated with |page_action|.
180 views::View* GetPageActionView(ExtensionAction* page_action); 181 views::View* GetPageActionView(ExtensionAction* page_action);
181 182
182 // Toggles the star on or off. 183 // Toggles the star on or off.
183 void SetStarToggled(bool on); 184 void SetStarToggled(bool on);
184 185
185 // Returns the star view. It may not be visible. 186 // Returns the star view. It may not be visible.
186 StarView* star_view() { return star_view_; } 187 StarView* star_view() { return star_view_; }
187 188
189 TranslateIconView* translate_icon_view() {
190 return translate_icon_view_;
191 }
192
188 // Shows the bookmark prompt. 193 // Shows the bookmark prompt.
189 void ShowBookmarkPrompt(); 194 void ShowBookmarkPrompt();
190 195
191 // Returns the screen coordinates of the location entry (where the URL text 196 // Returns the screen coordinates of the location entry (where the URL text
192 // appears, not where the icons are shown). 197 // appears, not where the icons are shown).
193 gfx::Point GetLocationEntryOrigin() const; 198 gfx::Point GetLocationEntryOrigin() const;
194 199
195 // Shows |text| as an inline autocompletion. This is useful for IMEs, where 200 // Shows |text| as an inline autocompletion. This is useful for IMEs, where
196 // we can't show the autocompletion inside the actual OmniboxView. See 201 // we can't show the autocompletion inside the actual OmniboxView. See
197 // comments on |ime_inline_autocomplete_view_|. 202 // comments on |ime_inline_autocomplete_view_|.
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // UpdateContentSettingViewsPostLayout(), to ensure the icons can completely 377 // UpdateContentSettingViewsPostLayout(), to ensure the icons can completely
373 // update their states. 378 // update their states.
374 void UpdateContentSettingViewsPreLayout(); 379 void UpdateContentSettingViewsPreLayout();
375 380
376 // Updates after the correct screen coordinates have been set for icons. 381 // Updates after the correct screen coordinates have been set for icons.
377 // Allows content setting icons to perform any updating which can't complete 382 // Allows content setting icons to perform any updating which can't complete
378 // until after the icons have been correctly laid out. This should be called 383 // until after the icons have been correctly laid out. This should be called
379 // after UpdateContentSettingViewsPreLayout() and a subsequent Layout(). 384 // after UpdateContentSettingViewsPreLayout() and a subsequent Layout().
380 void UpdateContentSettingViewsPostLayout(); 385 void UpdateContentSettingViewsPostLayout();
381 386
382 // Delete all page action views that we have created. 387 // Deletes all page action views that we have created.
383 void DeletePageActionViews(); 388 void DeletePageActionViews();
384 389
385 // Update the views for the Page Actions, to reflect state changes for 390 // Updates the views for the Page Actions, to reflect state changes for
386 // PageActions. 391 // PageActions.
387 void RefreshPageActionViews(); 392 void RefreshPageActionViews();
388 393
389 // Returns the number of scripts currently running on the page. 394 // Returns the number of scripts currently running on the page.
390 size_t ScriptBubbleScriptsRunning(); 395 size_t ScriptBubbleScriptsRunning();
391 396
392 // Update the Script Bubble Icon, to reflect the number of content scripts 397 // Updates the Script Bubble Icon, to reflect the number of content scripts
393 // running on the page. 398 // running on the page.
394 void RefreshScriptBubble(); 399 void RefreshScriptBubble();
395 400
396 // Update the view for the zoom icon based on the current tab's zoom. 401 // Updates the view for the zoom icon based on the current tab's zoom.
397 void RefreshZoomView(); 402 void RefreshZoomView();
398 403
404 // Updates the Translate icon based on the current tab's Translate status.
405 void RefreshTranslateIcon();
406
407 // Sets the visibility of view to new_vis.
408 void ToggleVisibility(bool new_vis, views::View* view);
409
399 #if !defined(USE_AURA) 410 #if !defined(USE_AURA)
400 // Helper for the Mouse event handlers that does all the real work. 411 // Helper for the Mouse event handlers that does all the real work.
401 void OnMouseEvent(const ui::MouseEvent& event, UINT msg); 412 void OnMouseEvent(const ui::MouseEvent& event, UINT msg);
402 #endif 413 #endif
403 414
404 // Returns true if the suggest text is valid. 415 // Returns true if the suggest text is valid.
405 bool HasValidSuggestText() const; 416 bool HasValidSuggestText() const;
406 417
407 // Helper to show the first run info bubble. 418 // Helper to show the first run info bubble.
408 void ShowFirstRunBubbleInternal(); 419 void ShowFirstRunBubbleInternal();
409 420
410 // Draw backgrounds and borders for page actions. Must be called 421 // Draws backgrounds and borders for page actions. Must be called
411 // after layout, so the |page_action_views_| have their bounds. 422 // after layout, so the |page_action_views_| have their bounds.
412 void PaintPageActionBackgrounds(gfx::Canvas* canvas); 423 void PaintPageActionBackgrounds(gfx::Canvas* canvas);
413 424
414 // Handles a request to change the value of this text field from software 425 // Handles a request to change the value of this text field from software
415 // using an accessibility API (typically automation software, screen readers 426 // using an accessibility API (typically automation software, screen readers
416 // don't normally use this). Sets the value and clears the selection. 427 // don't normally use this). Sets the value and clears the selection.
417 void AccessibilitySetValue(const string16& new_value); 428 void AccessibilitySetValue(const string16& new_value);
418 429
419 // The Browser this LocationBarView is in. Note that at least 430 // The Browser this LocationBarView is in. Note that at least
420 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser 431 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 496
486 // The page action icon views. 497 // The page action icon views.
487 PageActionViews page_action_views_; 498 PageActionViews page_action_views_;
488 499
489 // The script bubble. 500 // The script bubble.
490 ScriptBubbleIconView* script_bubble_icon_view_; 501 ScriptBubbleIconView* script_bubble_icon_view_;
491 502
492 // The star. 503 // The star.
493 StarView* star_view_; 504 StarView* star_view_;
494 505
506 // The icon for Translate.
507 TranslateIconView* translate_icon_view_;
508
495 // Whether we're in popup mode. This value also controls whether the location 509 // Whether we're in popup mode. This value also controls whether the location
496 // bar is read-only. 510 // bar is read-only.
497 const bool is_popup_mode_; 511 const bool is_popup_mode_;
498 512
499 // True if we should show a focus rect while the location entry field is 513 // True if we should show a focus rect while the location entry field is
500 // focused. Used when the toolbar is in full keyboard accessibility mode. 514 // focused. Used when the toolbar is in full keyboard accessibility mode.
501 bool show_focus_rect_; 515 bool show_focus_rect_;
502 516
503 // This is in case we're destroyed before the model loads. We need to make 517 // This is in case we're destroyed before the model loads. We need to make
504 // Add/RemoveObserver calls. 518 // Add/RemoveObserver calls.
(...skipping 11 matching lines...) Expand all
516 // Used to register for notifications received by NotificationObserver. 530 // Used to register for notifications received by NotificationObserver.
517 content::NotificationRegistrar registrar_; 531 content::NotificationRegistrar registrar_;
518 532
519 // Used to bind callback functions to this object. 533 // Used to bind callback functions to this object.
520 base::WeakPtrFactory<LocationBarView> weak_ptr_factory_; 534 base::WeakPtrFactory<LocationBarView> weak_ptr_factory_;
521 535
522 DISALLOW_COPY_AND_ASSIGN(LocationBarView); 536 DISALLOW_COPY_AND_ASSIGN(LocationBarView);
523 }; 537 };
524 538
525 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 539 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698