| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 // Returns the number of scripts currently running on the page. | 407 // Returns the number of scripts currently running on the page. |
| 407 size_t ScriptBubbleScriptsRunning(); | 408 size_t ScriptBubbleScriptsRunning(); |
| 408 | 409 |
| 409 // Update the Script Bubble Icon, to reflect the number of content scripts | 410 // Update the Script Bubble Icon, to reflect the number of content scripts |
| 410 // running on the page. | 411 // running on the page. |
| 411 void RefreshScriptBubble(); | 412 void RefreshScriptBubble(); |
| 412 | 413 |
| 413 // Update the view for the zoom icon based on the current tab's zoom. | 414 // Update the view for the zoom icon based on the current tab's zoom. |
| 414 void RefreshZoomView(); | 415 void RefreshZoomView(); |
| 415 | 416 |
| 416 // Sets the visibility of view to new_vis. | |
| 417 void ToggleVisibility(bool new_vis, views::View* view); | |
| 418 | |
| 419 #if !defined(USE_AURA) | 417 #if !defined(USE_AURA) |
| 420 // Helper for the Mouse event handlers that does all the real work. | 418 // Helper for the Mouse event handlers that does all the real work. |
| 421 void OnMouseEvent(const ui::MouseEvent& event, UINT msg); | 419 void OnMouseEvent(const ui::MouseEvent& event, UINT msg); |
| 422 #endif | 420 #endif |
| 423 | 421 |
| 424 // Returns true if the suggest text is valid. | 422 // Returns true if the suggest text is valid. |
| 425 bool HasValidSuggestText() const; | 423 bool HasValidSuggestText() const; |
| 426 | 424 |
| 427 // Helper to show the first run info bubble. | 425 // Helper to show the first run info bubble. |
| 428 void ShowFirstRunBubbleInternal(); | 426 void ShowFirstRunBubbleInternal(); |
| 429 | 427 |
| 430 // Draw backgrounds and borders for page actions. Must be called | 428 // Draw backgrounds and borders for page actions. Must be called |
| 431 // after layout, so the |page_action_views_| have their bounds. | 429 // after layout, so the |page_action_views_| have their bounds. |
| 432 void PaintPageActionBackgrounds(gfx::Canvas* canvas); | 430 void PaintPageActionBackgrounds(gfx::Canvas* canvas); |
| 433 | 431 |
| 432 // Handles a request to change the value of this text field from software |
| 433 // using an accessibility API (typically automation software, screen readers |
| 434 // don't normally use this). Sets the value and clears the selection. |
| 435 void AccessibilitySetValue(const string16& new_value); |
| 436 |
| 434 // The Browser this LocationBarView is in. Note that at least | 437 // The Browser this LocationBarView is in. Note that at least |
| 435 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 438 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
| 436 // window, so this may be NULL. | 439 // window, so this may be NULL. |
| 437 Browser* browser_; | 440 Browser* browser_; |
| 438 | 441 |
| 439 // The Autocomplete Edit field. | 442 // The Autocomplete Edit field. |
| 440 scoped_ptr<OmniboxView> location_entry_; | 443 scoped_ptr<OmniboxView> location_entry_; |
| 441 | 444 |
| 442 // The profile which corresponds to this View. | 445 // The profile which corresponds to this View. |
| 443 Profile* profile_; | 446 Profile* profile_; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 539 |
| 537 // While animating, the host clips the widget and draws only the bottom | 540 // While animating, the host clips the widget and draws only the bottom |
| 538 // part of it. The view needs to know the pixel offset at which we are drawing | 541 // part of it. The view needs to know the pixel offset at which we are drawing |
| 539 // the widget so that we can draw the curved edges that attach to the toolbar | 542 // the widget so that we can draw the curved edges that attach to the toolbar |
| 540 // in the right location. | 543 // in the right location. |
| 541 int animation_offset_; | 544 int animation_offset_; |
| 542 | 545 |
| 543 // Used to register for notifications received by NotificationObserver. | 546 // Used to register for notifications received by NotificationObserver. |
| 544 content::NotificationRegistrar registrar_; | 547 content::NotificationRegistrar registrar_; |
| 545 | 548 |
| 549 // Used to bind callback functions to this object. |
| 550 base::WeakPtrFactory<LocationBarView> weak_ptr_factory_; |
| 551 |
| 546 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 552 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 547 }; | 553 }; |
| 548 | 554 |
| 549 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 555 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |