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

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

Issue 10736028: Refactor browser window zoom handling and enable zoom icon on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 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 #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
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "chrome/browser/extensions/extension_context_menu_model.h" 12 #include "chrome/browser/extensions/extension_context_menu_model.h"
13 #include "chrome/browser/prefs/pref_member.h" 13 #include "chrome/browser/prefs/pref_member.h"
14 #include "chrome/browser/search_engines/template_url_service_observer.h" 14 #include "chrome/browser/search_engines/template_url_service_observer.h"
15 #include "chrome/browser/ui/omnibox/location_bar.h" 15 #include "chrome/browser/ui/omnibox/location_bar.h"
16 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 16 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
17 #include "chrome/browser/ui/search/search_model_observer.h" 17 #include "chrome/browser/ui/search/search_model_observer.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"
23 #include "content/public/browser/notification_observer.h" 22 #include "content/public/browser/notification_observer.h"
24 #include "content/public/browser/notification_registrar.h" 23 #include "content/public/browser/notification_registrar.h"
25 #include "ui/gfx/font.h" 24 #include "ui/gfx/font.h"
26 #include "ui/gfx/rect.h" 25 #include "ui/gfx/rect.h"
27 #include "ui/views/controls/native/native_view_host.h" 26 #include "ui/views/controls/native/native_view_host.h"
28 #include "ui/views/drag_controller.h" 27 #include "ui/views/drag_controller.h"
29 28
30 #if defined(USE_AURA) 29 #if defined(USE_AURA)
31 #include "ui/compositor/layer_animation_observer.h" 30 #include "ui/compositor/layer_animation_observer.h"
32 #endif 31 #endif
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore 177 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore
179 // saved state that the tab holds. 178 // saved state that the tab holds.
180 void Update(const content::WebContents* tab_for_state_restoring); 179 void Update(const content::WebContents* tab_for_state_restoring);
181 180
182 // Returns corresponding profile. 181 // Returns corresponding profile.
183 Profile* profile() const { return profile_; } 182 Profile* profile() const { return profile_; }
184 183
185 // Returns the delegate. 184 // Returns the delegate.
186 Delegate* delegate() const { return delegate_; } 185 Delegate* delegate() const { return delegate_; }
187 186
188 // Sets the tooltip for the zoom icon. 187 // Happens when the zoom is changed for the active tab either by switching the
189 void SetZoomIconTooltipPercent(int zoom_percent); 188 // active tab or a user changing the zoom through a key stroke or via the
190 189 // wrench menu. |can_show_bubble| will be true if it seems to be a user action
191 // Sets the zoom icon state. 190 // and there are no other things showing in the bubble's way.
192 void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state); 191 void ZoomChangedForActiveTab(bool can_show_bubble);
193
194 // Shows the zoom bubble.
195 void ShowZoomBubble(int zoom_percent);
196 192
197 // Sets |preview_enabled| for the PageAction View associated with this 193 // Sets |preview_enabled| for the PageAction View associated with this
198 // |page_action|. If |preview_enabled| is true, the view will display the 194 // |page_action|. If |preview_enabled| is true, the view will display the
199 // PageActions icon even though it has not been activated by the extension. 195 // PageActions icon even though it has not been activated by the extension.
200 // This is used by the ExtensionInstalledBubble to preview what the icon 196 // This is used by the ExtensionInstalledBubble to preview what the icon
201 // will look like for the user upon installation of the extension. 197 // will look like for the user upon installation of the extension.
202 void SetPreviewEnabledPageAction(ExtensionAction* page_action, 198 void SetPreviewEnabledPageAction(ExtensionAction* page_action,
203 bool preview_enabled); 199 bool preview_enabled);
204 200
205 // Retrieves the PageAction View which is associated with |page_action|. 201 // Retrieves the PageAction View which is associated with |page_action|.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // actually blocked on the current page. 407 // actually blocked on the current page.
412 void RefreshContentSettingViews(); 408 void RefreshContentSettingViews();
413 409
414 // Delete all page action views that we have created. 410 // Delete all page action views that we have created.
415 void DeletePageActionViews(); 411 void DeletePageActionViews();
416 412
417 // Update the views for the Page Actions, to reflect state changes for 413 // Update the views for the Page Actions, to reflect state changes for
418 // PageActions. 414 // PageActions.
419 void RefreshPageActionViews(); 415 void RefreshPageActionViews();
420 416
417 // Update the view for the zoom icon based on the current tab's zoom.
418 void RefreshZoomView();
419
421 // Sets the visibility of view to new_vis. 420 // Sets the visibility of view to new_vis.
422 void ToggleVisibility(bool new_vis, views::View* view); 421 void ToggleVisibility(bool new_vis, views::View* view);
423 422
424 #if !defined(USE_AURA) 423 #if !defined(USE_AURA)
425 // Helper for the Mouse event handlers that does all the real work. 424 // Helper for the Mouse event handlers that does all the real work.
426 void OnMouseEvent(const ui::MouseEvent& event, UINT msg); 425 void OnMouseEvent(const ui::MouseEvent& event, UINT msg);
427 #endif 426 #endif
428 427
429 // Returns true if the suggest text is valid. 428 // Returns true if the suggest text is valid.
430 bool HasValidSuggestText() const; 429 bool HasValidSuggestText() const;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 561
563 #if defined(USE_AURA) 562 #if defined(USE_AURA)
564 // Observer for a fade-in animation. 563 // Observer for a fade-in animation.
565 scoped_ptr<FadeAnimationObserver> fade_animation_observer_; 564 scoped_ptr<FadeAnimationObserver> fade_animation_observer_;
566 #endif 565 #endif
567 566
568 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); 567 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView);
569 }; 568 };
570 569
571 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 570 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698