OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 window_(NULL), | 371 window_(NULL), |
372 tab_strip_model_delegate_(new chrome::BrowserTabStripModelDelegate(this)), | 372 tab_strip_model_delegate_(new chrome::BrowserTabStripModelDelegate(this)), |
373 tab_strip_model_( | 373 tab_strip_model_( |
374 new TabStripModel(tab_strip_model_delegate_.get(), params.profile)), | 374 new TabStripModel(tab_strip_model_delegate_.get(), params.profile)), |
375 app_name_(params.app_name), | 375 app_name_(params.app_name), |
376 is_trusted_source_(params.trusted_source), | 376 is_trusted_source_(params.trusted_source), |
377 cancel_download_confirmation_state_(NOT_PROMPTED), | 377 cancel_download_confirmation_state_(NOT_PROMPTED), |
378 override_bounds_(params.initial_bounds), | 378 override_bounds_(params.initial_bounds), |
379 initial_show_state_(params.initial_show_state), | 379 initial_show_state_(params.initial_show_state), |
380 is_session_restore_(params.is_session_restore), | 380 is_session_restore_(params.is_session_restore), |
381 host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE), | |
382 content_setting_bubble_model_delegate_( | 381 content_setting_bubble_model_delegate_( |
383 new BrowserContentSettingBubbleModelDelegate(this)), | 382 new BrowserContentSettingBubbleModelDelegate(this)), |
384 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), | 383 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), |
385 live_tab_context_(new BrowserLiveTabContext(this)), | 384 live_tab_context_(new BrowserLiveTabContext(this)), |
386 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), | 385 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), |
387 bookmark_bar_state_(BookmarkBar::HIDDEN), | 386 bookmark_bar_state_(BookmarkBar::HIDDEN), |
388 command_controller_(new chrome::BrowserCommandController(this)), | 387 command_controller_(new chrome::BrowserCommandController(this)), |
389 window_has_shown_(false), | 388 window_has_shown_(false), |
390 chrome_updater_factory_(this), | 389 chrome_updater_factory_(this), |
391 weak_factory_(this) { | 390 weak_factory_(this) { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 // The web app frame uses the host instead of the title. | 616 // The web app frame uses the host instead of the title. |
618 if (ShouldUseWebAppFrame()) | 617 if (ShouldUseWebAppFrame()) |
619 return base::UTF8ToUTF16(contents->GetURL().host()); | 618 return base::UTF8ToUTF16(contents->GetURL().host()); |
620 | 619 |
621 title = contents->GetTitle(); | 620 title = contents->GetTitle(); |
622 FormatTitleForDisplay(&title); | 621 FormatTitleForDisplay(&title); |
623 } | 622 } |
624 if (title.empty()) | 623 if (title.empty()) |
625 title = CoreTabHelper::GetDefaultTitle(); | 624 title = CoreTabHelper::GetDefaultTitle(); |
626 | 625 |
627 #if defined(OS_MACOSX) | 626 #if defined(OS_MACOSX) || defined(USE_ASH) |
628 // On Mac, we don't want to suffix the page title with | 627 // On Mac and Ash, we don't want to suffix the page title with the application |
629 // the application name. | 628 // name. |
630 return title; | 629 return title; |
631 #elif defined(USE_ASH) | |
632 // On Ash, we don't want to suffix the page title with the application name, | |
633 // but on Windows, where USE_ASH can also be true, we still want the prefix | |
634 // on desktop. | |
635 if (host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | |
636 return title; | |
637 #endif | 630 #endif |
638 // Don't append the app name to window titles on app frames and app popups | 631 // Don't append the app name to window titles on app frames and app popups |
639 return is_app() ? | 632 return is_app() ? |
640 title : | 633 title : |
641 l10n_util::GetStringFUTF16(IDS_BROWSER_WINDOW_TITLE_FORMAT, title); | 634 l10n_util::GetStringFUTF16(IDS_BROWSER_WINDOW_TITLE_FORMAT, title); |
642 } | 635 } |
643 | 636 |
644 // static | 637 // static |
645 void Browser::FormatTitleForDisplay(base::string16* title) { | 638 void Browser::FormatTitleForDisplay(base::string16* title) { |
646 size_t current_index = 0; | 639 size_t current_index = 0; |
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 if (contents && !allow_js_access) { | 2730 if (contents && !allow_js_access) { |
2738 contents->web_contents()->GetController().LoadURL( | 2731 contents->web_contents()->GetController().LoadURL( |
2739 target_url, | 2732 target_url, |
2740 content::Referrer(), | 2733 content::Referrer(), |
2741 ui::PAGE_TRANSITION_LINK, | 2734 ui::PAGE_TRANSITION_LINK, |
2742 std::string()); // No extra headers. | 2735 std::string()); // No extra headers. |
2743 } | 2736 } |
2744 | 2737 |
2745 return contents != NULL; | 2738 return contents != NULL; |
2746 } | 2739 } |
OLD | NEW |