| OLD | NEW |
| 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 "base/memory/weak_ptr.h" |
| 12 #include "base/prefs/pref_member.h" | 13 #include "base/prefs/pref_member.h" |
| 13 #include "chrome/browser/extensions/extension_context_menu_model.h" | 14 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 14 #include "chrome/browser/search_engines/template_url_service_observer.h" | 15 #include "chrome/browser/search_engines/template_url_service_observer.h" |
| 15 #include "chrome/browser/ui/omnibox/location_bar.h" | 16 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 16 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 17 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| 17 #include "chrome/browser/ui/search/search_model_observer.h" | 18 #include "chrome/browser/ui/search/search_model_observer.h" |
| 18 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 19 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 19 #include "chrome/browser/ui/views/dropdown_bar_host.h" | 20 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
| 20 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" | 21 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" |
| 21 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 22 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 // Returns the number of scripts currently running on the page. | 398 // Returns the number of scripts currently running on the page. |
| 398 size_t ScriptBubbleScriptsRunning(); | 399 size_t ScriptBubbleScriptsRunning(); |
| 399 | 400 |
| 400 // Update the Script Bubble Icon, to reflect the number of content scripts | 401 // Update the Script Bubble Icon, to reflect the number of content scripts |
| 401 // running on the page. | 402 // running on the page. |
| 402 void RefreshScriptBubble(); | 403 void RefreshScriptBubble(); |
| 403 | 404 |
| 404 // Update the view for the zoom icon based on the current tab's zoom. | 405 // Update the view for the zoom icon based on the current tab's zoom. |
| 405 void RefreshZoomView(); | 406 void RefreshZoomView(); |
| 406 | 407 |
| 407 // Sets the visibility of view to new_vis. | |
| 408 void ToggleVisibility(bool new_vis, views::View* view); | |
| 409 | |
| 410 #if !defined(USE_AURA) | 408 #if !defined(USE_AURA) |
| 411 // Helper for the Mouse event handlers that does all the real work. | 409 // Helper for the Mouse event handlers that does all the real work. |
| 412 void OnMouseEvent(const ui::MouseEvent& event, UINT msg); | 410 void OnMouseEvent(const ui::MouseEvent& event, UINT msg); |
| 413 #endif | 411 #endif |
| 414 | 412 |
| 415 // Returns true if the suggest text is valid. | 413 // Returns true if the suggest text is valid. |
| 416 bool HasValidSuggestText() const; | 414 bool HasValidSuggestText() const; |
| 417 | 415 |
| 418 // Helper to show the first run info bubble. | 416 // Helper to show the first run info bubble. |
| 419 void ShowFirstRunBubbleInternal(); | 417 void ShowFirstRunBubbleInternal(); |
| 420 | 418 |
| 421 // Draw backgrounds and borders for page actions. Must be called | 419 // Draw backgrounds and borders for page actions. Must be called |
| 422 // after layout, so the |page_action_views_| have their bounds. | 420 // after layout, so the |page_action_views_| have their bounds. |
| 423 void PaintPageActionBackgrounds(gfx::Canvas* canvas); | 421 void PaintPageActionBackgrounds(gfx::Canvas* canvas); |
| 424 | 422 |
| 423 // Handles a request to change the value of this text field from software |
| 424 // using an accessibility API (typically automation software, screen readers |
| 425 // don't normally use this). Sets the value and clears the selection. |
| 426 void AccessibilitySetValue(const string16& new_value); |
| 427 |
| 425 // The Browser this LocationBarView is in. Note that at least | 428 // The Browser this LocationBarView is in. Note that at least |
| 426 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 429 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
| 427 // window, so this may be NULL. | 430 // window, so this may be NULL. |
| 428 Browser* browser_; | 431 Browser* browser_; |
| 429 | 432 |
| 430 // The Autocomplete Edit field. | 433 // The Autocomplete Edit field. |
| 431 scoped_ptr<OmniboxView> location_entry_; | 434 scoped_ptr<OmniboxView> location_entry_; |
| 432 | 435 |
| 433 // The profile which corresponds to this View. | 436 // The profile which corresponds to this View. |
| 434 Profile* profile_; | 437 Profile* profile_; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 530 |
| 528 // While animating, the host clips the widget and draws only the bottom | 531 // While animating, the host clips the widget and draws only the bottom |
| 529 // part of it. The view needs to know the pixel offset at which we are drawing | 532 // part of it. The view needs to know the pixel offset at which we are drawing |
| 530 // the widget so that we can draw the curved edges that attach to the toolbar | 533 // the widget so that we can draw the curved edges that attach to the toolbar |
| 531 // in the right location. | 534 // in the right location. |
| 532 int animation_offset_; | 535 int animation_offset_; |
| 533 | 536 |
| 534 // Used to register for notifications received by NotificationObserver. | 537 // Used to register for notifications received by NotificationObserver. |
| 535 content::NotificationRegistrar registrar_; | 538 content::NotificationRegistrar registrar_; |
| 536 | 539 |
| 540 // Used to bind callback functions to this object. |
| 541 base::WeakPtrFactory<LocationBarView> weak_ptr_factory_; |
| 542 |
| 537 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 543 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 538 }; | 544 }; |
| 539 | 545 |
| 540 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 546 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |