| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_NAVIGATION_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_NAVIGATION_ENTRY_H_ |
| 6 #define CHROME_BROWSER_NAVIGATION_ENTRY_H_ | 6 #define CHROME_BROWSER_NAVIGATION_ENTRY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/app/theme/theme_resources.h" | 10 #include "chrome/app/theme/theme_resources.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 PageType page_type() const { | 213 PageType page_type() const { |
| 214 return page_type_; | 214 return page_type_; |
| 215 } | 215 } |
| 216 | 216 |
| 217 // The actual URL of the page. For some about pages, this may be a scary | 217 // The actual URL of the page. For some about pages, this may be a scary |
| 218 // data: URL or something like that. Use display_url() below for showing to | 218 // data: URL or something like that. Use display_url() below for showing to |
| 219 // the user. | 219 // the user. |
| 220 void set_url(const GURL& url) { | 220 void set_url(const GURL& url) { |
| 221 url_ = url; | 221 url_ = url; |
| 222 url_as_string_ = UTF8ToWide(url_.spec()); |
| 222 } | 223 } |
| 223 const GURL& url() const { | 224 const GURL& url() const { |
| 224 return url_; | 225 return url_; |
| 225 } | 226 } |
| 226 | 227 |
| 227 // The display URL, when nonempty, will override the actual URL of the page | 228 // The display URL, when nonempty, will override the actual URL of the page |
| 228 // when we display it to the user. This allows us to have nice and friendly | 229 // when we display it to the user. This allows us to have nice and friendly |
| 229 // URLs that the user sees for things like about: URLs, but actually feed | 230 // URLs that the user sees for things like about: URLs, but actually feed |
| 230 // the renderer a data URL that results in the content loading. | 231 // the renderer a data URL that results in the content loading. |
| 231 // | 232 // |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // Was this entry created from session/tab restore? If so this is true and | 338 // Was this entry created from session/tab restore? If so this is true and |
| 338 // gets set to false once we navigate to it. | 339 // gets set to false once we navigate to it. |
| 339 // (See NavigationController::DidNavigateToEntry). | 340 // (See NavigationController::DidNavigateToEntry). |
| 340 void set_restored(bool restored) { | 341 void set_restored(bool restored) { |
| 341 restored_ = restored; | 342 restored_ = restored; |
| 342 } | 343 } |
| 343 bool restored() const { | 344 bool restored() const { |
| 344 return restored_; | 345 return restored_; |
| 345 } | 346 } |
| 346 | 347 |
| 348 // Returns the title to be displayed on the tab. This could be the title of |
| 349 // the page if it is available or the URL. |
| 350 const std::wstring& GetTitleForDisplay(); |
| 351 |
| 347 private: | 352 private: |
| 348 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 353 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 349 // Session/Tab restore save portions of this class so that it can be recreated | 354 // Session/Tab restore save portions of this class so that it can be recreated |
| 350 // later. If you add a new field that needs to be persisted you'll have to | 355 // later. If you add a new field that needs to be persisted you'll have to |
| 351 // update SessionService/TabRestoreService appropriately. | 356 // update SessionService/TabRestoreService appropriately. |
| 352 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 357 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 353 | 358 |
| 354 // See the accessors above for descriptions. | 359 // See the accessors above for descriptions. |
| 355 int unique_id_; | 360 int unique_id_; |
| 356 TabContentsType tab_type_; | 361 TabContentsType tab_type_; |
| 357 scoped_refptr<SiteInstance> site_instance_; | 362 scoped_refptr<SiteInstance> site_instance_; |
| 358 PageType page_type_; | 363 PageType page_type_; |
| 359 GURL url_; | 364 GURL url_; |
| 365 std::wstring url_as_string_; |
| 360 GURL display_url_; | 366 GURL display_url_; |
| 361 std::wstring title_; | 367 std::wstring title_; |
| 362 FaviconStatus favicon_; | 368 FaviconStatus favicon_; |
| 363 std::string content_state_; | 369 std::string content_state_; |
| 364 int32 page_id_; | 370 int32 page_id_; |
| 365 SSLStatus ssl_; | 371 SSLStatus ssl_; |
| 366 PageTransition::Type transition_type_; | 372 PageTransition::Type transition_type_; |
| 367 GURL user_typed_url_; | 373 GURL user_typed_url_; |
| 368 bool has_post_data_; | 374 bool has_post_data_; |
| 369 bool restored_; | 375 bool restored_; |
| 370 | 376 |
| 371 // Copy and assignment is explicitly allowed for this class. | 377 // Copy and assignment is explicitly allowed for this class. |
| 372 }; | 378 }; |
| 373 | 379 |
| 374 #endif // CHROME_BROWSER_NAVIGATION_ENTRY_H_ | 380 #endif // CHROME_BROWSER_NAVIGATION_ENTRY_H_ |
| OLD | NEW |