| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VIEWS_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 static SkColor GetColor(bool is_secure, ColorKind kind); | 88 static SkColor GetColor(bool is_secure, ColorKind kind); |
| 89 | 89 |
| 90 // Updates the location bar. We also reset the bar's permanent text and | 90 // Updates the location bar. We also reset the bar's permanent text and |
| 91 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore | 91 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore |
| 92 // saved state that the tab holds. | 92 // saved state that the tab holds. |
| 93 void Update(const TabContents* tab_for_state_restoring); | 93 void Update(const TabContents* tab_for_state_restoring); |
| 94 | 94 |
| 95 void SetProfile(Profile* profile); | 95 void SetProfile(Profile* profile); |
| 96 Profile* profile() { return profile_; } | 96 Profile* profile() { return profile_; } |
| 97 | 97 |
| 98 // Sets |preview_enabled| for the PageAction View associated with this |
| 99 // |page_action|. If |preview_enabled| is true, the view will display the |
| 100 // PageActions icon even though it has not been activated by the extension. |
| 101 // This is used by the ExtensionInstalledBubble to preview what the icon |
| 102 // will look like for the user upon installation of the extension. |
| 103 void SetPreviewEnabledPageAction(ExtensionAction *page_action, |
| 104 bool preview_enabled); |
| 105 |
| 106 // Retrieves the PageAction View which is associated with |page_action| |
| 107 views::View* GetPageActionView(ExtensionAction* page_action); |
| 108 |
| 98 // Sizing functions | 109 // Sizing functions |
| 99 virtual gfx::Size GetPreferredSize(); | 110 virtual gfx::Size GetPreferredSize(); |
| 100 | 111 |
| 101 // Layout and Painting functions | 112 // Layout and Painting functions |
| 102 virtual void Layout(); | 113 virtual void Layout(); |
| 103 virtual void Paint(gfx::Canvas* canvas); | 114 virtual void Paint(gfx::Canvas* canvas); |
| 104 | 115 |
| 105 // No focus border for the location bar, the caret is enough. | 116 // No focus border for the location bar, the caret is enough. |
| 106 virtual void PaintFocusBorder(gfx::Canvas* canvas) { } | 117 virtual void PaintFocusBorder(gfx::Canvas* canvas) { } |
| 107 | 118 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 PageActionImageView(LocationBarView* owner, | 364 PageActionImageView(LocationBarView* owner, |
| 354 Profile* profile, | 365 Profile* profile, |
| 355 ExtensionAction* page_action, | 366 ExtensionAction* page_action, |
| 356 const BubblePositioner* bubble_positioner); | 367 const BubblePositioner* bubble_positioner); |
| 357 virtual ~PageActionImageView(); | 368 virtual ~PageActionImageView(); |
| 358 | 369 |
| 359 ExtensionAction* page_action() { return page_action_; } | 370 ExtensionAction* page_action() { return page_action_; } |
| 360 | 371 |
| 361 int current_tab_id() { return current_tab_id_; } | 372 int current_tab_id() { return current_tab_id_; } |
| 362 | 373 |
| 374 void set_preview_enabled(bool preview_enabled) { |
| 375 preview_enabled_ = preview_enabled; |
| 376 } |
| 377 |
| 363 // Overridden from view. | 378 // Overridden from view. |
| 364 virtual void OnMouseMoved(const views::MouseEvent& event); | 379 virtual void OnMouseMoved(const views::MouseEvent& event); |
| 365 virtual bool OnMousePressed(const views::MouseEvent& event); | 380 virtual bool OnMousePressed(const views::MouseEvent& event); |
| 366 | 381 |
| 367 // Overridden from LocationBarImageView. | 382 // Overridden from LocationBarImageView. |
| 368 virtual void ShowInfoBubble(); | 383 virtual void ShowInfoBubble(); |
| 369 | 384 |
| 370 // Overridden from ImageLoadingTracker. | 385 // Overridden from ImageLoadingTracker. |
| 371 virtual void OnImageLoaded(SkBitmap* image, size_t index); | 386 virtual void OnImageLoaded(SkBitmap* image, size_t index); |
| 372 | 387 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 399 | 414 |
| 400 // The tab id we are currently showing the icon for. | 415 // The tab id we are currently showing the icon for. |
| 401 int current_tab_id_; | 416 int current_tab_id_; |
| 402 | 417 |
| 403 // The URL we are currently showing the icon for. | 418 // The URL we are currently showing the icon for. |
| 404 GURL current_url_; | 419 GURL current_url_; |
| 405 | 420 |
| 406 // The string to show for a tooltip; | 421 // The string to show for a tooltip; |
| 407 std::string tooltip_; | 422 std::string tooltip_; |
| 408 | 423 |
| 424 // This is used for post-install visual feedback. The page_action icon |
| 425 // is briefly shown even if it hasn't been enabled by it's extension. |
| 426 bool preview_enabled_; |
| 427 |
| 409 DISALLOW_COPY_AND_ASSIGN(PageActionImageView); | 428 DISALLOW_COPY_AND_ASSIGN(PageActionImageView); |
| 410 }; | 429 }; |
| 411 friend class PageActionImageView; | 430 friend class PageActionImageView; |
| 412 | 431 |
| 413 class PageActionWithBadgeView; | 432 class PageActionWithBadgeView; |
| 414 friend class PageActionWithBadgeView; | 433 friend class PageActionWithBadgeView; |
| 415 // Both Layout and OnChanged call into this. This updates the contents | 434 // Both Layout and OnChanged call into this. This updates the contents |
| 416 // of the 3 views: selected_keyword, keyword_hint and type_search_view. If | 435 // of the 3 views: selected_keyword, keyword_hint and type_search_view. If |
| 417 // force_layout is true, or one of these views has changed in such a way as | 436 // force_layout is true, or one of these views has changed in such a way as |
| 418 // to necessitate a layout, layout occurs as well. | 437 // to necessitate a layout, layout occurs as well. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // The positioner that places the omnibox and info bubbles. | 564 // The positioner that places the omnibox and info bubbles. |
| 546 const BubblePositioner* bubble_positioner_; | 565 const BubblePositioner* bubble_positioner_; |
| 547 | 566 |
| 548 // Storage of string needed for accessibility. | 567 // Storage of string needed for accessibility. |
| 549 std::wstring accessible_name_; | 568 std::wstring accessible_name_; |
| 550 | 569 |
| 551 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 570 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 552 }; | 571 }; |
| 553 | 572 |
| 554 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 573 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |