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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 // Overridden from LocationBarImageView. | 326 // Overridden from LocationBarImageView. |
327 virtual void ShowInfoBubble(); | 327 virtual void ShowInfoBubble(); |
328 | 328 |
329 // Called to notify the PageAction that it should determine whether to be | 329 // Called to notify the PageAction that it should determine whether to be |
330 // visible or hidden. |contents| is the TabContents that is active, |url| | 330 // visible or hidden. |contents| is the TabContents that is active, |url| |
331 // is the current page URL. | 331 // is the current page URL. |
332 void UpdateVisibility(TabContents* contents, GURL url); | 332 void UpdateVisibility(TabContents* contents, GURL url); |
333 | 333 |
334 // A callback for when the image has loaded. | 334 // A callback for when the image has loaded. |
335 void OnImageLoaded(SkBitmap* image); | 335 void OnImageLoaded(SkBitmap* image, size_t index); |
336 | 336 |
337 private: | 337 private: |
338 // We load the images for the PageActions on the file thread. These tasks | 338 // We load the images for the PageActions on the file thread. These tasks |
339 // help with that. | 339 // help with that. |
340 class LoadImageTask; | 340 class LoadImageTask; |
341 class ImageLoadingTracker; | 341 class ImageLoadingTracker; |
342 | 342 |
343 // The location bar view that owns us. | 343 // The location bar view that owns us. |
344 LocationBarView* owner_; | 344 LocationBarView* owner_; |
345 | 345 |
346 // The current profile (not owned by us). | 346 // The current profile (not owned by us). |
347 Profile* profile_; | 347 Profile* profile_; |
348 | 348 |
349 // The PageAction that this view represents. The PageAction is not owned by | 349 // The PageAction that this view represents. The PageAction is not owned by |
350 // us, it resides in the extension of this particular profile. | 350 // us, it resides in the extension of this particular profile. |
351 const PageAction* page_action_; | 351 const PageAction* page_action_; |
352 | 352 |
| 353 // The icons representing different states for the page action. |
| 354 std::vector<SkBitmap> page_action_icons_; |
| 355 |
353 // The object that is waiting for the image loading to complete | 356 // The object that is waiting for the image loading to complete |
354 // asynchronously. | 357 // asynchronously. |
355 ImageLoadingTracker* tracker_; | 358 ImageLoadingTracker* tracker_; |
356 | 359 |
357 // The tab id we are currently showing the icon for. | 360 // The tab id we are currently showing the icon for. |
358 int current_tab_id_; | 361 int current_tab_id_; |
359 | 362 |
360 // The URL we are currently showing the icon for. | 363 // The URL we are currently showing the icon for. |
361 GURL current_url_; | 364 GURL current_url_; |
362 | 365 |
| 366 // The string to show for a tooltip; |
| 367 std::string tooltip_; |
| 368 |
363 DISALLOW_COPY_AND_ASSIGN(PageActionImageView); | 369 DISALLOW_COPY_AND_ASSIGN(PageActionImageView); |
364 }; | 370 }; |
365 | 371 |
366 // Both Layout and OnChanged call into this. This updates the contents | 372 // Both Layout and OnChanged call into this. This updates the contents |
367 // of the 3 views: selected_keyword, keyword_hint and type_search_view. If | 373 // of the 3 views: selected_keyword, keyword_hint and type_search_view. If |
368 // force_layout is true, or one of these views has changed in such a way as | 374 // force_layout is true, or one of these views has changed in such a way as |
369 // to necessitate a layout, layout occurs as well. | 375 // to necessitate a layout, layout occurs as well. |
370 void DoLayout(bool force_layout); | 376 void DoLayout(bool force_layout); |
371 | 377 |
372 // Returns the height in pixels of the margin at the top of the bar. | 378 // Returns the height in pixels of the margin at the top of the bar. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 bool popup_window_mode_; | 499 bool popup_window_mode_; |
494 | 500 |
495 // Used schedule a task for the first run info bubble. | 501 // Used schedule a task for the first run info bubble. |
496 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 502 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; |
497 | 503 |
498 // The positioner that places the autocomplete popup. | 504 // The positioner that places the autocomplete popup. |
499 AutocompletePopupPositioner* popup_positioner_; | 505 AutocompletePopupPositioner* popup_positioner_; |
500 }; | 506 }; |
501 | 507 |
502 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 508 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
OLD | NEW |