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

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: fix mac 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 | 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore 175 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore
177 // saved state that the tab holds. 176 // saved state that the tab holds.
178 void Update(const content::WebContents* tab_for_state_restoring); 177 void Update(const content::WebContents* tab_for_state_restoring);
179 178
180 // Returns corresponding profile. 179 // Returns corresponding profile.
181 Profile* profile() const { return profile_; } 180 Profile* profile() const { return profile_; }
182 181
183 // Returns the delegate. 182 // Returns the delegate.
184 Delegate* delegate() const { return delegate_; } 183 Delegate* delegate() const { return delegate_; }
185 184
186 // Sets the tooltip for the zoom icon. 185 // Happens when the zoom is changed for the active tab either by switching the
187 void SetZoomIconTooltipPercent(int zoom_percent); 186 // active tab or a user changing the zoom through a key stroke or via the
188 187 // wrench menu. |can_show_bubble| will be true if it seems to be a user action
189 // Sets the zoom icon state. 188 // and there are no other things showing in the bubble's way.
190 void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state); 189 void ZoomChangedForActiveTab(bool can_show_bubble);
191
192 // Shows the zoom bubble.
193 void ShowZoomBubble(int zoom_percent);
194 190
195 // Sets |preview_enabled| for the PageAction View associated with this 191 // Sets |preview_enabled| for the PageAction View associated with this
196 // |page_action|. If |preview_enabled| is true, the view will display the 192 // |page_action|. If |preview_enabled| is true, the view will display the
197 // PageActions icon even though it has not been activated by the extension. 193 // PageActions icon even though it has not been activated by the extension.
198 // This is used by the ExtensionInstalledBubble to preview what the icon 194 // This is used by the ExtensionInstalledBubble to preview what the icon
199 // will look like for the user upon installation of the extension. 195 // will look like for the user upon installation of the extension.
200 void SetPreviewEnabledPageAction(ExtensionAction* page_action, 196 void SetPreviewEnabledPageAction(ExtensionAction* page_action,
201 bool preview_enabled); 197 bool preview_enabled);
202 198
203 // Retrieves the PageAction View which is associated with |page_action|. 199 // Retrieves the PageAction View which is associated with |page_action|.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // actually blocked on the current page. 405 // actually blocked on the current page.
410 void RefreshContentSettingViews(); 406 void RefreshContentSettingViews();
411 407
412 // Delete all page action views that we have created. 408 // Delete all page action views that we have created.
413 void DeletePageActionViews(); 409 void DeletePageActionViews();
414 410
415 // Update the views for the Page Actions, to reflect state changes for 411 // Update the views for the Page Actions, to reflect state changes for
416 // PageActions. 412 // PageActions.
417 void RefreshPageActionViews(); 413 void RefreshPageActionViews();
418 414
415 // Update the view for the zoom icon based on the current tab's zoom.
416 void RefreshZoomView();
417
419 // Sets the visibility of view to new_vis. 418 // Sets the visibility of view to new_vis.
420 void ToggleVisibility(bool new_vis, views::View* view); 419 void ToggleVisibility(bool new_vis, views::View* view);
421 420
422 #if !defined(USE_AURA) 421 #if !defined(USE_AURA)
423 // Helper for the Mouse event handlers that does all the real work. 422 // Helper for the Mouse event handlers that does all the real work.
424 void OnMouseEvent(const views::MouseEvent& event, UINT msg); 423 void OnMouseEvent(const views::MouseEvent& event, UINT msg);
425 #endif 424 #endif
426 425
427 // Returns true if the suggest text is valid. 426 // Returns true if the suggest text is valid.
428 bool HasValidSuggestText() const; 427 bool HasValidSuggestText() const;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 554
556 #if defined(USE_AURA) 555 #if defined(USE_AURA)
557 // Observer for a fade-in animation. 556 // Observer for a fade-in animation.
558 scoped_ptr<FadeAnimationObserver> fade_animation_observer_; 557 scoped_ptr<FadeAnimationObserver> fade_animation_observer_;
559 #endif 558 #endif
560 559
561 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); 560 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView);
562 }; 561 };
563 562
564 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 563 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698