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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 401 |
402 // Returns true if the location bar should be focused by default rather than | 402 // Returns true if the location bar should be focused by default rather than |
403 // the page contents. The view calls this function when the tab is focused | 403 // the page contents. The view calls this function when the tab is focused |
404 // to see what it should do. | 404 // to see what it should do. |
405 virtual bool FocusLocationBarByDefault() = 0; | 405 virtual bool FocusLocationBarByDefault() = 0; |
406 | 406 |
407 // Does this have an opener associated with it? | 407 // Does this have an opener associated with it? |
408 virtual bool HasOpener() const = 0; | 408 virtual bool HasOpener() const = 0; |
409 | 409 |
410 typedef base::Callback<void(int, /* id */ | 410 typedef base::Callback<void(int, /* id */ |
| 411 int, /* HTTP status code */ |
411 const GURL&, /* image_url */ | 412 const GURL&, /* image_url */ |
412 int, /* requested_size */ | 413 int, /* requested_size */ |
413 const std::vector<SkBitmap>& /* bitmaps*/)> | 414 const std::vector<SkBitmap>& /* bitmaps*/)> |
414 ImageDownloadCallback; | 415 ImageDownloadCallback; |
415 | 416 |
416 // Sends a request to download the given image |url| and returns the unique | 417 // Sends a request to download the given image |url| and returns the unique |
417 // id of the download request. When the download is finished, |callback| will | 418 // id of the download request. When the download is finished, |callback| will |
418 // be called with the bitmaps received from the renderer. If |is_favicon| is | 419 // be called with the bitmaps received from the renderer. If |is_favicon| is |
419 // true, the cookies are not sent and not accepted during download. Note that | 420 // true, the cookies are not sent and not accepted during download. Note that |
420 // |image_size| is a hint for images with multiple sizes. The downloaded image | 421 // |image_size| is a hint for images with multiple sizes. The downloaded image |
421 // is not resized to the given image_size. If 0 is passed, the first frame of | 422 // is not resized to the given image_size. If 0 is passed, the first frame of |
422 // the image is returned. | 423 // the image is returned. |
423 virtual int DownloadImage(const GURL& url, | 424 virtual int DownloadImage(const GURL& url, |
424 bool is_favicon, | 425 bool is_favicon, |
425 int image_size, | 426 int image_size, |
426 const ImageDownloadCallback& callback) = 0; | 427 const ImageDownloadCallback& callback) = 0; |
427 | 428 |
428 private: | 429 private: |
429 // This interface should only be implemented inside content. | 430 // This interface should only be implemented inside content. |
430 friend class WebContentsImpl; | 431 friend class WebContentsImpl; |
431 WebContents() {} | 432 WebContents() {} |
432 }; | 433 }; |
433 | 434 |
434 } // namespace content | 435 } // namespace content |
435 | 436 |
436 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 437 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |