Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model.cc

Issue 10827272: Drive: Hide the URL on opening files on Drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/toolbar/toolbar_model.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autocomplete/autocomplete_input.h" 8 #include "chrome/browser/autocomplete/autocomplete_input.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (entry->IsViewSourceMode() || 80 if (entry->IsViewSourceMode() ||
81 entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { 81 entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) {
82 return true; 82 return true;
83 } 83 }
84 } 84 }
85 85
86 WebContents* web_contents = delegate_->GetActiveWebContents(); 86 WebContents* web_contents = delegate_->GetActiveWebContents();
87 if (web_contents && web_contents->GetWebUIForCurrentState()) 87 if (web_contents && web_contents->GetWebUIForCurrentState())
88 return !web_contents->GetWebUIForCurrentState()->ShouldHideURL(); 88 return !web_contents->GetWebUIForCurrentState()->ShouldHideURL();
89 89
90 if (entry && entry->GetURL().SchemeIs(chrome::kExtensionScheme)) 90 if (entry && (entry->GetURL().SchemeIs(chrome::kExtensionScheme) ||
91 #if defined(OS_CHROMEOS)
Aaron Boodman 2012/08/10 04:36:56 I'm not a fan of mixing runtime and compile time c
yoshiki 2012/08/10 05:34:34 Done.
92 entry->GetURL().SchemeIs(chrome::kDriveScheme)
93 #endif
94 )) {
91 return false; 95 return false;
96 }
92 97
93 return true; 98 return true;
94 } 99 }
95 100
96 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { 101 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const {
97 if (input_in_progress_) // When editing, assume no security style. 102 if (input_in_progress_) // When editing, assume no security style.
98 return NONE; 103 return NONE;
99 104
100 NavigationController* navigation_controller = GetNavigationController(); 105 NavigationController* navigation_controller = GetNavigationController();
101 if (!navigation_controller) // We might not have a controller on init. 106 if (!navigation_controller) // We might not have a controller on init.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 UTF8ToUTF16(cert.subject().country_name)); 174 UTF8ToUTF16(cert.subject().country_name));
170 } 175 }
171 176
172 NavigationController* ToolbarModel::GetNavigationController() const { 177 NavigationController* ToolbarModel::GetNavigationController() const {
173 // This |current_tab| can be NULL during the initialization of the 178 // This |current_tab| can be NULL during the initialization of the
174 // toolbar during window creation (i.e. before any tabs have been added 179 // toolbar during window creation (i.e. before any tabs have been added
175 // to the window). 180 // to the window).
176 WebContents* current_tab = delegate_->GetActiveWebContents(); 181 WebContents* current_tab = delegate_->GetActiveWebContents();
177 return current_tab ? &current_tab->GetController() : NULL; 182 return current_tab ? &current_tab->GetController() : NULL;
178 } 183 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698