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

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

Issue 10494004: Implements a zoom icon in the Omnibox for Views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments, improved code executed when a new bubble is opened when another already exists Created 8 years, 5 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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "chrome/browser/extensions/extension_context_menu_model.h" 13 #include "chrome/browser/extensions/extension_context_menu_model.h"
14 #include "chrome/browser/prefs/pref_member.h" 14 #include "chrome/browser/prefs/pref_member.h"
15 #include "chrome/browser/search_engines/template_url_service_observer.h" 15 #include "chrome/browser/search_engines/template_url_service_observer.h"
16 #include "chrome/browser/ui/omnibox/location_bar.h" 16 #include "chrome/browser/ui/omnibox/location_bar.h"
17 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 17 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
18 #include "chrome/browser/ui/toolbar/toolbar_model.h" 18 #include "chrome/browser/ui/toolbar/toolbar_model.h"
19 #include "chrome/browser/ui/views/dropdown_bar_host.h" 19 #include "chrome/browser/ui/views/dropdown_bar_host.h"
20 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" 20 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
21 #include "chrome/browser/ui/views/extensions/extension_popup.h" 21 #include "chrome/browser/ui/views/extensions/extension_popup.h"
22 #include "chrome/browser/ui/zoom/zoom_controller.h"
22 #include "content/public/browser/notification_observer.h" 23 #include "content/public/browser/notification_observer.h"
23 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
24 #include "ui/gfx/font.h" 25 #include "ui/gfx/font.h"
25 #include "ui/gfx/rect.h" 26 #include "ui/gfx/rect.h"
26 #include "ui/views/controls/native/native_view_host.h" 27 #include "ui/views/controls/native/native_view_host.h"
27 #include "ui/views/drag_controller.h" 28 #include "ui/views/drag_controller.h"
28 29
29 class ActionBoxButtonView; 30 class ActionBoxButtonView;
30 class ChromeToMobileView; 31 class ChromeToMobileView;
31 class CommandUpdater; 32 class CommandUpdater;
32 class ContentSettingBubbleModelDelegate; 33 class ContentSettingBubbleModelDelegate;
33 class ContentSettingImageView; 34 class ContentSettingImageView;
34 class EVBubbleView; 35 class EVBubbleView;
35 class ExtensionAction; 36 class ExtensionAction;
36 class GURL; 37 class GURL;
37 class InstantController; 38 class InstantController;
38 class KeywordHintView; 39 class KeywordHintView;
39 class LocationIconView; 40 class LocationIconView;
40 class PageActionWithBadgeView; 41 class PageActionWithBadgeView;
41 class PageActionImageView; 42 class PageActionImageView;
42 class Profile; 43 class Profile;
43 class SelectedKeywordView; 44 class SelectedKeywordView;
44 class StarView; 45 class StarView;
45 class SuggestedTextView; 46 class SuggestedTextView;
46 class TabContents; 47 class TabContents;
47 class TemplateURLService; 48 class TemplateURLService;
49 class ZoomView;
48 50
49 namespace views { 51 namespace views {
50 class BubbleDelegateView; 52 class BubbleDelegateView;
51 class Widget; 53 class Widget;
52 } 54 }
53 55
54 ///////////////////////////////////////////////////////////////////////////// 56 /////////////////////////////////////////////////////////////////////////////
55 // 57 //
56 // LocationBarView class 58 // LocationBarView class
57 // 59 //
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 Profile* profile() const { return profile_; } 166 Profile* profile() const { return profile_; }
165 167
166 // Returns the delegate. 168 // Returns the delegate.
167 Delegate* delegate() const { return delegate_; } 169 Delegate* delegate() const { return delegate_; }
168 170
169 // Sets |preview_enabled| for the PageAction View associated with this 171 // Sets |preview_enabled| for the PageAction View associated with this
170 // |page_action|. If |preview_enabled| is true, the view will display the 172 // |page_action|. If |preview_enabled| is true, the view will display the
171 // PageActions icon even though it has not been activated by the extension. 173 // PageActions icon even though it has not been activated by the extension.
172 // This is used by the ExtensionInstalledBubble to preview what the icon 174 // This is used by the ExtensionInstalledBubble to preview what the icon
173 // will look like for the user upon installation of the extension. 175 // will look like for the user upon installation of the extension.
174 void SetPreviewEnabledPageAction(ExtensionAction *page_action, 176 void SetPreviewEnabledPageAction(ExtensionAction *page_action,
Peter Kasting 2012/06/26 23:23:39 Nit: While you're here, can you fix the "*" locati
Kyle Horimoto 2012/06/30 00:22:50 Done.
175 bool preview_enabled); 177 bool preview_enabled);
176 178
177 // Retrieves the PageAction View which is associated with |page_action|. 179 // Retrieves the PageAction View which is associated with |page_action|.
178 views::View* GetPageActionView(ExtensionAction* page_action); 180 views::View* GetPageActionView(ExtensionAction* page_action);
179 181
180 // Toggles the star on or off. 182 // Toggles the star on or off.
181 void SetStarToggled(bool on); 183 void SetStarToggled(bool on);
182 184
183 // Shows the bookmark bubble. 185 // Shows the bookmark bubble.
184 void ShowStarBubble(const GURL& url, bool newly_bookmarked); 186 void ShowStarBubble(const GURL& url, bool newly_bookmarked);
185 187
188 // Sets the tooltip for the zoom icon.
Peter Kasting 2012/06/26 23:23:39 Tiny nit: For ordering consistency, let's move the
Kyle Horimoto 2012/06/30 00:22:50 Done.
189 void SetZoomIconTooltipPercent(int zoom_percent);
190
191 // Sets the zoom icon state.
192 void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state);
193
194 // Show the zoom bubble.
Peter Kasting 2012/06/26 23:23:39 Nit: Show -> Shows
Kyle Horimoto 2012/06/30 00:22:50 Done.
195 void ShowZoomBubble(int zoom_percent);
196
186 // Shows the Chrome To Mobile bubble. 197 // Shows the Chrome To Mobile bubble.
187 void ShowChromeToMobileBubble(); 198 void ShowChromeToMobileBubble();
188 199
189 // Returns the screen coordinates of the location entry (where the URL text 200 // Returns the screen coordinates of the location entry (where the URL text
190 // appears, not where the icons are shown). 201 // appears, not where the icons are shown).
191 gfx::Point GetLocationEntryOrigin() const; 202 gfx::Point GetLocationEntryOrigin() const;
192 203
193 // Invoked from OmniboxViewWin to show the instant suggestion. 204 // Invoked from OmniboxViewWin to show the instant suggestion.
194 void SetInstantSuggestion(const string16& text, 205 void SetInstantSuggestion(const string16& text,
195 bool animate_to_complete); 206 bool animate_to_complete);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // View responsible for showing suggested text. This is NULL when there is no 448 // View responsible for showing suggested text. This is NULL when there is no
438 // suggested text. 449 // suggested text.
439 SuggestedTextView* suggested_text_view_; 450 SuggestedTextView* suggested_text_view_;
440 451
441 // Shown if the selected url has a corresponding keyword. 452 // Shown if the selected url has a corresponding keyword.
442 KeywordHintView* keyword_hint_view_; 453 KeywordHintView* keyword_hint_view_;
443 454
444 // The content setting views. 455 // The content setting views.
445 ContentSettingViews content_setting_views_; 456 ContentSettingViews content_setting_views_;
446 457
458 // The zoom icon.
459 ZoomView* zoom_view_;
460
447 // The current page actions. 461 // The current page actions.
448 std::vector<ExtensionAction*> page_actions_; 462 std::vector<ExtensionAction*> page_actions_;
449 463
450 // The page action icon views. 464 // The page action icon views.
451 PageActionViews page_action_views_; 465 PageActionViews page_action_views_;
452 466
453 // The star. 467 // The star.
454 StarView* star_view_; 468 StarView* star_view_;
455 469
456 // The action box button (plus). 470 // The action box button (plus).
(...skipping 26 matching lines...) Expand all
483 content::NotificationRegistrar registrar_; 497 content::NotificationRegistrar registrar_;
484 498
485 // The view to give focus to. This is either |this| or the 499 // The view to give focus to. This is either |this| or the
486 // LocationBarContainer. 500 // LocationBarContainer.
487 views::View* view_to_focus_; 501 views::View* view_to_focus_;
488 502
489 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); 503 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView);
490 }; 504 };
491 505
492 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 506 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698