| 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 #include "chrome/browser/ui/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 void ShowPageInfo(Browser* browser, | 634 void ShowPageInfo(Browser* browser, |
| 635 content::WebContents* web_contents, | 635 content::WebContents* web_contents, |
| 636 const GURL& url, | 636 const GURL& url, |
| 637 const SSLStatus& ssl, | 637 const SSLStatus& ssl, |
| 638 bool show_history) { | 638 bool show_history) { |
| 639 Profile* profile = Profile::FromBrowserContext( | 639 Profile* profile = Profile::FromBrowserContext( |
| 640 web_contents->GetBrowserContext()); | 640 web_contents->GetBrowserContext()); |
| 641 TabContents* tab_contents = TabContents::FromWebContents(web_contents); | 641 TabContents* tab_contents = TabContents::FromWebContents(web_contents); |
| 642 | 642 |
| 643 if (CommandLine::ForCurrentProcess()->HasSwitch( | 643 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 644 switches::kEnableWebsiteSettings)) { | 644 switches::kDisableWebsiteSettings)) { |
| 645 browser->window()->ShowPageInfo(web_contents, url, ssl, show_history); |
| 646 } else { |
| 645 browser->window()->ShowWebsiteSettings( | 647 browser->window()->ShowWebsiteSettings( |
| 646 profile, tab_contents, url, ssl, show_history); | 648 profile, tab_contents, url, ssl, show_history); |
| 647 } else { | |
| 648 browser->window()->ShowPageInfo(web_contents, url, ssl, show_history); | |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 | 651 |
| 652 void ShowChromeToMobileBubble(Browser* browser) { | 652 void ShowChromeToMobileBubble(Browser* browser) { |
| 653 // Only show the bubble if the window is active, otherwise we may get into | 653 // Only show the bubble if the window is active, otherwise we may get into |
| 654 // weird situations where the bubble is deleted as soon as it is shown. | 654 // weird situations where the bubble is deleted as soon as it is shown. |
| 655 if (browser->window()->IsActive()) | 655 if (browser->window()->IsActive()) |
| 656 browser->window()->ShowChromeToMobileBubble(); | 656 browser->window()->ShowChromeToMobileBubble(); |
| 657 } | 657 } |
| 658 | 658 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 if (!tab_contents) | 982 if (!tab_contents) |
| 983 tab_contents = new TabContents(contents); | 983 tab_contents = new TabContents(contents); |
| 984 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 984 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
| 985 | 985 |
| 986 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 986 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 987 contents->GetRenderViewHost()->SyncRendererPrefs(); | 987 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 988 app_browser->window()->Show(); | 988 app_browser->window()->Show(); |
| 989 } | 989 } |
| 990 | 990 |
| 991 } // namespace chrome | 991 } // namespace chrome |
| OLD | NEW |