diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 17:03:08 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 17:03:08 +0000 |
commit | 98aa0b5c0dd2f6721d7c1bb81fe87812fe5573ee (patch) | |
tree | 77dd37111cdb925321816cc66da4110d43a03880 /chrome/browser | |
parent | 54903eaa08bde272797e0f2a6befa213dd93b9b6 (diff) | |
download | chromium_src-98aa0b5c0dd2f6721d7c1bb81fe87812fe5573ee.zip chromium_src-98aa0b5c0dd2f6721d7c1bb81fe87812fe5573ee.tar.gz chromium_src-98aa0b5c0dd2f6721d7c1bb81fe87812fe5573ee.tar.bz2 |
Rename all occurrences of "app extension" with "extension app" since we were using both and consistency is nice.
Review URL: http://codereview.chromium.org/1924002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
21 files changed, 185 insertions, 185 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 1807e67..0561187 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -186,7 +186,7 @@ bool FindOpenAppInstanceInBrowser(Browser* browser, if (!tab_contents) continue; - if (tab_contents->app_extension() != extension_app) + if (tab_contents->extension_app() != extension_app) continue; *out_tab_idx = tab_idx; @@ -624,7 +624,7 @@ TabContents* Browser::OpenApplicationTab(Profile* profile, TabContents* tab_contents = browser->CreateTabContentsForURL(url, GURL(), profile, transition, false, NULL); - tab_contents->SetAppExtension(extension); + tab_contents->SetExtensionApp(extension); browser->AddTab(tab_contents, transition); return tab_contents; } @@ -875,7 +875,7 @@ TabContents* Browser::AddTabWithURL(const GURL& url, int index, int add_types, SiteInstance* instance, - const std::string& app_extension_id) { + const std::string& extension_app_id) { TabContents* contents = NULL; if (CanSupportWindowFeature(FEATURE_TABSTRIP) || tabstrip_model()->empty()) { GURL url_to_load = url; @@ -883,7 +883,7 @@ TabContents* Browser::AddTabWithURL(const GURL& url, url_to_load = GetHomePage(); contents = CreateTabContentsForURL(url_to_load, referrer, profile_, transition, false, instance); - contents->SetAppExtensionById(app_extension_id); + contents->SetExtensionAppById(extension_app_id); // TODO(sky): TabStripModel::AddTabContents should take add_types directly. tabstrip_model_.AddTabContents(contents, index, (add_types & ADD_FORCE_INDEX) != 0, @@ -908,7 +908,7 @@ TabContents* Browser::AddTabWithURL(const GURL& url, if (!b) b = Browser::Create(profile_); contents = b->AddTabWithURL(url, referrer, transition, index, add_types, - instance, app_extension_id); + instance, extension_app_id); b->window()->Show(); } return contents; @@ -948,13 +948,13 @@ TabContents* Browser::AddRestoredTab( const std::vector<TabNavigation>& navigations, int tab_index, int selected_navigation, - const std::string& app_extension_id, + const std::string& extension_app_id, bool select, bool pin, bool from_last_session) { TabContents* new_tab = new TabContents(profile(), NULL, MSG_ROUTING_NONE, tabstrip_model_.GetSelectedTabContents()); - new_tab->SetAppExtensionById(app_extension_id); + new_tab->SetExtensionAppById(extension_app_id); new_tab->controller().RestoreFromState(navigations, selected_navigation, from_last_session); @@ -987,10 +987,10 @@ void Browser::ReplaceRestoredTab( const std::vector<TabNavigation>& navigations, int selected_navigation, bool from_last_session, - const std::string& app_extension_id) { + const std::string& extension_app_id) { TabContents* replacement = new TabContents(profile(), NULL, MSG_ROUTING_NONE, tabstrip_model_.GetSelectedTabContents()); - replacement->SetAppExtensionById(app_extension_id); + replacement->SetExtensionAppById(extension_app_id); replacement->controller().RestoreFromState(navigations, selected_navigation, from_last_session); @@ -3540,7 +3540,7 @@ bool Browser::HandleCrossAppNavigation(TabContents* source, return false; // Get the source extension, if any. - Extension* source_extension = source->app_extension(); + Extension* source_extension = source->extension_app(); if (!source_extension) source_extension = extension_app_; @@ -3588,7 +3588,7 @@ bool Browser::HandleCrossAppNavigation(TabContents* source, // If our source tab is an app tab, don't allow normal web content to // overwrite it. - if (source->app_extension() && *disposition == CURRENT_TAB) + if (source->extension_app() && *disposition == CURRENT_TAB) *disposition = NEW_FOREGROUND_TAB; return false; diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 93a59fb..5b070e2 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -330,14 +330,14 @@ class Browser : public TabStripModelDelegate, // Adds a new tab at the specified index. |add_types| is a bitmask of the // values defined by AddTabTypes; see AddTabTypes for details. If |instance| // is not null, its process will be used to render the tab. If - // |app_extension_id| is non-empty the new tab is an app tab. + // |extension_app_id| is non-empty the new tab is an app tab. TabContents* AddTabWithURL(const GURL& url, const GURL& referrer, PageTransition::Type transition, int index, int add_types, SiteInstance* instance, - const std::string& app_extension_id); + const std::string& extension_app_id); // Add a new tab, given a TabContents. A TabContents appropriate to // display the last committed entry is created and returned. @@ -346,15 +346,15 @@ class Browser : public TabStripModelDelegate, // Add a tab with its session history restored from the SessionRestore // system. If select is true, the tab is selected. |tab_index| gives the index // to insert the tab at. |selected_navigation| is the index of the - // TabNavigation in |navigations| to select. If |app_extension_id| is - // non-empty the tab is an app tab and |app_extension_id| is the id of the + // TabNavigation in |navigations| to select. If |extension_app_id| is + // non-empty the tab is an app tab and |extension_app_id| is the id of the // extension. If |pin| is true and |tab_index|/ is the last pinned tab, then // the newly created tab is pinned. If |from_last_session| is true, // |navigations| are from the previous session. TabContents* AddRestoredTab(const std::vector<TabNavigation>& navigations, int tab_index, int selected_navigation, - const std::string& app_extension_id, + const std::string& extension_app_id, bool select, bool pin, bool from_last_session); @@ -392,7 +392,7 @@ class Browser : public TabStripModelDelegate, const std::vector<TabNavigation>& navigations, int selected_navigation, bool from_last_session, - const std::string& app_extension_id); + const std::string& extension_app_id); // Returns true if a tab can be restored. virtual bool CanRestoreTab(); diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc index 1d9e340..176ae42 100644 --- a/chrome/browser/browser_browsertest.cc +++ b/chrome/browser/browser_browsertest.cc @@ -103,13 +103,13 @@ class BrowserTest : public ExtensionBrowserTest { ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); - Extension* app_extension = GetExtension(); + Extension* extension_app = GetExtension(); ui_test_utils::NavigateToURL(browser(), url); TabContents* app_contents = new TabContents(browser()->profile(), NULL, MSG_ROUTING_NONE, NULL); - app_contents->SetAppExtension(app_extension); + app_contents->SetExtensionApp(extension_app); model->AddTabContents(app_contents, 0, false, 0, false); model->SetTabPinned(0, true); @@ -436,13 +436,13 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, TabClosingWhenRemovingExtension) { ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); - Extension* app_extension = GetExtension(); + Extension* extension_app = GetExtension(); ui_test_utils::NavigateToURL(browser(), url); TabContents* app_contents = new TabContents(browser()->profile(), NULL, MSG_ROUTING_NONE, NULL); - app_contents->SetAppExtension(app_extension); + app_contents->SetExtensionApp(extension_app); model->AddTabContents(app_contents, 0, false, 0, false); model->SetTabPinned(0, true); @@ -529,11 +529,11 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, RestorePinnedTabs) { GURL url(server->TestServerPage("empty.html")); TabStripModel* model = browser()->tabstrip_model(); ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); - Extension* app_extension = GetExtension(); + Extension* extension_app = GetExtension(); ui_test_utils::NavigateToURL(browser(), url); TabContents* app_contents = new TabContents(browser()->profile(), NULL, MSG_ROUTING_NONE, NULL); - app_contents->SetAppExtension(app_extension); + app_contents->SetExtensionApp(extension_app); model->AddTabContents(app_contents, 0, false, 0, false); model->SetTabPinned(0, true); ui_test_utils::NavigateToURL(browser(), url); @@ -579,15 +579,15 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, RestorePinnedTabs) { EXPECT_TRUE(new_model->IsTabPinned(0)); EXPECT_TRUE(new_model->IsTabPinned(1)); - EXPECT_TRUE(new_model->GetTabContentsAt(0)->app_extension() == - app_extension); + EXPECT_TRUE(new_model->GetTabContentsAt(0)->extension_app() == + extension_app); } #endif // !defined(OS_CHROMEOS) class BrowserAppRefocusTest : public ExtensionBrowserTest { public: BrowserAppRefocusTest(): server_(NULL), - app_extension_(NULL), + extension_app_(NULL), profile_(NULL) {} protected: @@ -599,7 +599,7 @@ class BrowserAppRefocusTest : public ExtensionBrowserTest { // Common setup for all tests. Can't use SetUpInProcessBrowserTestFixture // because starting the http server crashes if called from that function. // The IO thread is not set up at that point. - virtual void SetUpAppExtension() { + virtual void SetUpExtensionApp() { server_ = StartHTTPServer(); ASSERT_TRUE(server_); host_resolver()->AddRule("www.example.com", "127.0.0.1"); @@ -610,19 +610,19 @@ class BrowserAppRefocusTest : public ExtensionBrowserTest { ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); - // Save a pointer to the loaded extension in |app_extension_|. + // Save a pointer to the loaded extension in |extension_app_|. const ExtensionList* extensions = profile_->GetExtensionsService()->extensions(); for (size_t i = 0; i < extensions->size(); ++i) { if ((*extensions)[i]->name() == "App Test") - app_extension_ =(*extensions)[i]; + extension_app_ =(*extensions)[i]; } - ASSERT_TRUE(app_extension_) << "App Test extension not loaded."; + ASSERT_TRUE(extension_app_) << "App Test extension not loaded."; } HTTPTestServer* server_; - Extension* app_extension_; + Extension* extension_app_; Profile* profile_; GURL url_; }; @@ -653,20 +653,20 @@ class BrowserAppRefocusTest : public ExtensionBrowserTest { // Test that launching an app refocuses a tab already hosting the app. IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenTab) { - SetUpAppExtension(); + SetUpExtensionApp(); ui_test_utils::NavigateToURL(browser(), url_); ASSERT_EQ(1, browser()->tab_count()); // Open a tab with the app. - Browser::OpenApplicationTab(profile_, app_extension_); + Browser::OpenApplicationTab(profile_, extension_app_); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); ASSERT_EQ(2, browser()->tab_count()); int app_tab_index = browser()->selected_index(); ASSERT_EQ(0, app_tab_index) << "App tab should be the left most tab."; // Open the same app. The existing tab should stay focused. - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); ASSERT_EQ(2, browser()->tab_count()); ASSERT_EQ(app_tab_index, browser()->selected_index()); @@ -674,20 +674,20 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenTab) { // Focus the other tab, and reopen the app. The existing tab should // be refocused. browser()->SelectTabContentsAt(1, false); - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); ASSERT_EQ(2, browser()->tab_count()); ASSERT_EQ(app_tab_index, browser()->selected_index()); } // Test that launching an app refocuses a panel running the app. IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenPanel) { - SetUpAppExtension(); + SetUpExtensionApp(); ui_test_utils::NavigateToURL(browser(), url_); ASSERT_EQ(1, browser()->tab_count()); // Open the app in a panel. - Browser::OpenApplicationWindow(profile_, app_extension_, + Browser::OpenApplicationWindow(profile_, extension_app_, Extension::LAUNCH_PANEL, GURL()); Browser* app_panel = BrowserList::GetLastActive(); ASSERT_TRUE(app_panel); @@ -699,7 +699,7 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenPanel) { ASSERT_EQ(browser(), BrowserList::GetLastActive()); // Open the app. - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); // Focus should move to the panel. ASSERT_EQ(app_panel, BrowserList::GetLastActive()); @@ -710,13 +710,13 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenPanel) { // Test that launching an app refocuses a window running the app. IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenWindow) { - SetUpAppExtension(); + SetUpExtensionApp(); ui_test_utils::NavigateToURL(browser(), url_); ASSERT_EQ(1, browser()->tab_count()); // Open a window with the app. - Browser::OpenApplicationWindow(profile_, app_extension_, + Browser::OpenApplicationWindow(profile_, extension_app_, Extension::LAUNCH_WINDOW, GURL()); Browser* app_window = BrowserList::GetLastActive(); ASSERT_TRUE(app_window); @@ -727,7 +727,7 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenWindow) { ASSERT_EQ(browser(), BrowserList::GetLastActive()); // Open the app. - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); // Focus should move to the window. ASSERT_EQ(app_window, BrowserList::GetLastActive()); @@ -739,20 +739,20 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_OpenWindow) { // Test that if an app is opened while running in a window and a tab, // the window is focused. IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_WindowBeforeTab) { - SetUpAppExtension(); + SetUpExtensionApp(); ui_test_utils::NavigateToURL(browser(), url_); ASSERT_EQ(1, browser()->tab_count()); // Open a tab with the app. - Browser::OpenApplicationTab(profile_, app_extension_); + Browser::OpenApplicationTab(profile_, extension_app_); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); ASSERT_EQ(2, browser()->tab_count()); int app_tab_index = browser()->selected_index(); ASSERT_EQ(0, app_tab_index) << "App tab should be the left most tab."; // Open a window with the app. - Browser::OpenApplicationWindow(profile_, app_extension_, + Browser::OpenApplicationWindow(profile_, extension_app_, Extension::LAUNCH_WINDOW, GURL()); Browser* app_window = BrowserList::GetLastActive(); ASSERT_TRUE(app_window); @@ -762,27 +762,27 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_WindowBeforeTab) { browser()->window()->Show(); // Open the app. Focus should move to the window. - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); ASSERT_EQ(app_window, BrowserList::GetLastActive()); } // Test that if an app is opened while running in a panel and a tab, // the panel is focused. IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_PanelBeforeTab) { - SetUpAppExtension(); + SetUpExtensionApp(); ui_test_utils::NavigateToURL(browser(), url_); ASSERT_EQ(1, browser()->tab_count()); // Open a tab with the app. - Browser::OpenApplicationTab(profile_, app_extension_); + Browser::OpenApplicationTab(profile_, extension_app_); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); ASSERT_EQ(2, browser()->tab_count()); int app_tab_index = browser()->selected_index(); ASSERT_EQ(0, app_tab_index) << "App tab should be the left most tab."; // Open a panel with the app. - Browser::OpenApplicationWindow(profile_, app_extension_, + Browser::OpenApplicationWindow(profile_, extension_app_, Extension::LAUNCH_PANEL, GURL()); Browser* app_panel = BrowserList::GetLastActive(); ASSERT_TRUE(app_panel); @@ -792,19 +792,19 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_PanelBeforeTab) { browser()->window()->Show(); // Open the app. Focus should move to the panel. - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); ASSERT_EQ(app_panel, BrowserList::GetLastActive()); } // Test that if multiple tabs host an app, and that app is opened, // the tab in the current window gets focus. IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_TabInFocusedWindow) { - SetUpAppExtension(); + SetUpExtensionApp(); ui_test_utils::NavigateToURL(browser(), url_); ASSERT_EQ(1, browser()->tab_count()); - Browser::OpenApplicationTab(profile_, app_extension_); + Browser::OpenApplicationTab(profile_, extension_app_); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); ASSERT_EQ(2, browser()->tab_count()); int app_tab_index = browser()->selected_index(); @@ -814,19 +814,19 @@ IN_PROC_BROWSER_TEST_F(BrowserAppRefocusTest, MAYBE_TabInFocusedWindow) { Browser* extra_browser = CreateBrowser(profile_); ASSERT_EQ(extra_browser, BrowserList::GetLastActive()); - Browser::OpenApplicationTab(profile_, app_extension_); + Browser::OpenApplicationTab(profile_, extension_app_); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(extra_browser)); ASSERT_EQ(2, extra_browser->tab_count()); app_tab_index = extra_browser->selected_index(); ASSERT_EQ(0, app_tab_index) << "App tab should be the left most tab"; // Open the app. Focus should move to the panel. - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); ASSERT_EQ(extra_browser, BrowserList::GetLastActive()); ASSERT_EQ(2, extra_browser->tab_count()); browser()->window()->Show(); - Browser::OpenApplication(profile_, app_extension_->id()); + Browser::OpenApplication(profile_, extension_app_->id()); ASSERT_EQ(browser(), BrowserList::GetLastActive()); ASSERT_EQ(2, browser()->tab_count()); } diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index 45479a9..6b809eb 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -180,7 +180,7 @@ SessionCommand* BaseSessionService::CreateUpdateTabNavigationCommand( return new SessionCommand(command_id, pickle); } -SessionCommand* BaseSessionService::CreateSetTabAppExtensionIDCommand( +SessionCommand* BaseSessionService::CreateSetTabExtensionAppIDCommand( SessionID::id_type command_id, SessionID::id_type tab_id, const std::string& extension_id) { @@ -233,17 +233,17 @@ bool BaseSessionService::RestoreUpdateTabNavigationCommand( return true; } -bool BaseSessionService::RestoreSetTabAppExtensionIDCommand( +bool BaseSessionService::RestoreSetTabExtensionAppIDCommand( const SessionCommand& command, SessionID::id_type* tab_id, - std::string* app_extension_id) { + std::string* extension_app_id) { scoped_ptr<Pickle> pickle(command.PayloadAsPickle()); if (!pickle.get()) return false; void* iterator = NULL; return pickle->ReadInt(&iterator, tab_id) && - pickle->ReadString(&iterator, app_extension_id); + pickle->ReadString(&iterator, extension_app_id); } bool BaseSessionService::ShouldTrackEntry(const NavigationEntry& entry) { diff --git a/chrome/browser/sessions/base_session_service.h b/chrome/browser/sessions/base_session_service.h index 39dbeca..a7aaa0d 100644 --- a/chrome/browser/sessions/base_session_service.h +++ b/chrome/browser/sessions/base_session_service.h @@ -120,7 +120,7 @@ class BaseSessionService : public CancelableRequestProvider, const NavigationEntry& entry); // Creates a SessionCommand that represents marking a tab as an application. - SessionCommand* CreateSetTabAppExtensionIDCommand( + SessionCommand* CreateSetTabExtensionAppIDCommand( SessionID::id_type command_id, SessionID::id_type tab_id, const std::string& extension_id); @@ -133,12 +133,12 @@ class BaseSessionService : public CancelableRequestProvider, SessionID::id_type* tab_id); // Extracts a SessionCommand as previously created by - // CreateSetTabAppExtensionIDCommand into the tab id and application + // CreateSetTabExtensionAppIDCommand into the tab id and application // extension id. - bool RestoreSetTabAppExtensionIDCommand( + bool RestoreSetTabExtensionAppIDCommand( const SessionCommand& command, SessionID::id_type* tab_id, - std::string* app_extension_id); + std::string* extension_app_id); // Returns true if the NavigationEntry should be written to disk. bool ShouldTrackEntry(const NavigationEntry& entry); diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index e6eb2b9..86b668d 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -282,7 +282,7 @@ class SessionRestoreImpl : public NotificationObserver { void OnGotSession(SessionService::Handle handle, std::vector<SessionWindow*>* windows) { - if (HasAppExtensions(*windows) && profile_->GetExtensionsService() && + if (HasExtensionApps(*windows) && profile_->GetExtensionsService() && !profile_->GetExtensionsService()->is_ready()) { // At least one tab is an app tab and the extension service hasn't // finished loading. Wait to continue processing until the extensions @@ -305,10 +305,10 @@ class SessionRestoreImpl : public NotificationObserver { } // Returns true if any tab in |windows| has an application extension id. - bool HasAppExtensions(const std::vector<SessionWindow*>& windows) { + bool HasExtensionApps(const std::vector<SessionWindow*>& windows) { for (std::vector<SessionWindow*>::const_iterator i = windows.begin(); i != windows.end(); ++i) { - if (HasAppExtensions((*i)->tabs)) + if (HasExtensionApps((*i)->tabs)) return true; } @@ -316,10 +316,10 @@ class SessionRestoreImpl : public NotificationObserver { } // Returns true if any tab in |tabs| has an application extension id. - bool HasAppExtensions(const std::vector<SessionTab*>& tabs) { + bool HasExtensionApps(const std::vector<SessionTab*>& tabs) { for (std::vector<SessionTab*>::const_iterator i = tabs.begin(); i != tabs.end(); ++i) { - if (!(*i)->app_extension_id.empty()) + if (!(*i)->extension_app_id.empty()) return true; } @@ -401,7 +401,7 @@ class SessionRestoreImpl : public NotificationObserver { tab_loader_->AddTab(&browser->AddRestoredTab(tab.navigations, static_cast<int>(i - window.tabs.begin()), selected_index, - tab.app_extension_id, + tab.extension_app_id, false, tab.pinned, true)->controller()); diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 1ef2a07..e5a734c 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -56,7 +56,7 @@ static const SessionCommand::id_type kCommandSetWindowBounds2 = 10; static const SessionCommand::id_type kCommandTabNavigationPathPrunedFromFront = 11; static const SessionCommand::id_type kCommandSetPinnedState = 12; -static const SessionCommand::id_type kCommandSetAppExtensionID = 13; +static const SessionCommand::id_type kCommandSetExtensionAppID = 13; // Every kWritesPerReset commands triggers recreating the file. static const int kWritesPerReset = 250; @@ -492,11 +492,11 @@ void SessionService::Observe(NotificationType type, NavigationController* controller = Source<NavigationController>(source).ptr(); SetTabWindow(controller->window_id(), controller->session_id()); - if (controller->tab_contents()->app_extension()) { - SetTabAppExtensionID( + if (controller->tab_contents()->extension_app()) { + SetTabExtensionAppID( controller->window_id(), controller->session_id(), - controller->tab_contents()->app_extension()->id()); + controller->tab_contents()->extension_app()->id()); } break; } @@ -549,10 +549,10 @@ void SessionService::Observe(NotificationType type, case NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: { TabContents* tab_contents = Source<TabContents>(source).ptr(); DCHECK(tab_contents); - if (tab_contents->app_extension()) { - SetTabAppExtensionID(tab_contents->controller().window_id(), + if (tab_contents->extension_app()) { + SetTabExtensionAppID(tab_contents->controller().window_id(), tab_contents->controller().session_id(), - tab_contents->app_extension()->id()); + tab_contents->extension_app()->id()); } break; } @@ -562,17 +562,17 @@ void SessionService::Observe(NotificationType type, } } -void SessionService::SetTabAppExtensionID( +void SessionService::SetTabExtensionAppID( const SessionID& window_id, const SessionID& tab_id, - const std::string& app_extension_id) { + const std::string& extension_app_id) { if (!ShouldTrackChangesToWindow(window_id)) return; - ScheduleCommand(CreateSetTabAppExtensionIDCommand( - kCommandSetAppExtensionID, + ScheduleCommand(CreateSetTabExtensionAppIDCommand( + kCommandSetExtensionAppID, tab_id.id(), - app_extension_id)); + extension_app_id)); } SessionCommand* SessionService::CreateSetSelectedTabInWindow( @@ -991,15 +991,15 @@ bool SessionService::CreateTabsAndWindows( break; } - case kCommandSetAppExtensionID: { + case kCommandSetExtensionAppID: { SessionID::id_type tab_id; - std::string app_extension_id; - if (!RestoreSetTabAppExtensionIDCommand( - *command, &tab_id, &app_extension_id)) { + std::string extension_app_id; + if (!RestoreSetTabExtensionAppIDCommand( + *command, &tab_id, &extension_app_id)) { return true; } - GetTab(tab_id, tabs)->app_extension_id.swap(app_extension_id); + GetTab(tab_id, tabs)->extension_app_id.swap(extension_app_id); break; } @@ -1034,12 +1034,12 @@ void SessionService::BuildCommandsForTab( commands->push_back( CreatePinnedStateCommand(controller->session_id(), true)); } - if (controller->tab_contents()->app_extension()) { + if (controller->tab_contents()->extension_app()) { commands->push_back( - CreateSetTabAppExtensionIDCommand( - kCommandSetAppExtensionID, + CreateSetTabExtensionAppIDCommand( + kCommandSetExtensionAppID, controller->session_id().id(), - controller->tab_contents()->app_extension()->id())); + controller->tab_contents()->extension_app()->id())); } for (int i = min_index; i < max_index; ++i) { const NavigationEntry* entry = (i == pending_index) ? diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index 278c94b..86421ca 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h @@ -197,9 +197,9 @@ class SessionService : public BaseSessionService, const NotificationDetails& details); // Sets the application extension id of the specified tab. - void SetTabAppExtensionID(const SessionID& window_id, + void SetTabExtensionAppID(const SessionID& window_id, const SessionID& tab_id, - const std::string& app_extension_id); + const std::string& extension_app_id); // Methods to create the various commands. It is up to the caller to delete // the returned the SessionCommand* object. diff --git a/chrome/browser/sessions/session_service_test_helper.cc b/chrome/browser/sessions/session_service_test_helper.cc index a36562d..fda500b 100644 --- a/chrome/browser/sessions/session_service_test_helper.cc +++ b/chrome/browser/sessions/session_service_test_helper.cc @@ -29,11 +29,11 @@ void SessionServiceTestHelper::PrepareTabInWindow(const SessionID& window_id, service()->SetSelectedTabInWindow(window_id, visual_index); } -void SessionServiceTestHelper::SetTabAppExtensionID( +void SessionServiceTestHelper::SetTabExtensionAppID( const SessionID& window_id, const SessionID& tab_id, - const std::string& app_extension_id) { - service()->SetTabAppExtensionID(window_id, tab_id, app_extension_id); + const std::string& extension_app_id) { + service()->SetTabExtensionAppID(window_id, tab_id, extension_app_id); } // Be sure and null out service to force closing the file. diff --git a/chrome/browser/sessions/session_service_test_helper.h b/chrome/browser/sessions/session_service_test_helper.h index 8239884..88f17c0 100644 --- a/chrome/browser/sessions/session_service_test_helper.h +++ b/chrome/browser/sessions/session_service_test_helper.h @@ -35,9 +35,9 @@ class SessionServiceTestHelper { int visual_index, bool select); - void SetTabAppExtensionID(const SessionID& window_id, + void SetTabExtensionAppID(const SessionID& window_id, const SessionID& tab_id, - const std::string& app_extension_id); + const std::string& extension_app_id); // Reads the contents of the last session. void ReadWindows(std::vector<SessionWindow*>* windows); diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc index 3a4e905..e39e780 100644 --- a/chrome/browser/sessions/session_service_unittest.cc +++ b/chrome/browser/sessions/session_service_unittest.cc @@ -514,7 +514,7 @@ TEST_F(SessionServiceTest, PruneFromFront) { ASSERT_EQ(1U, windows[0]->tabs.size()); // There shouldn't be an app id. - EXPECT_TRUE(windows[0]->tabs[0]->app_extension_id.empty()); + EXPECT_TRUE(windows[0]->tabs[0]->extension_app_id.empty()); // We should be left with three navigations, the 2nd selected. SessionTab* tab = windows[0]->tabs[0]; @@ -574,13 +574,13 @@ TEST_F(SessionServiceTest, PersistApplicationExtensionID) { helper_.PrepareTabInWindow(window_id, tab_id, 0, true); UpdateNavigation(window_id, tab_id, nav1, 0, true); - helper_.SetTabAppExtensionID(window_id, tab_id, app_id); + helper_.SetTabExtensionAppID(window_id, tab_id, app_id); ScopedVector<SessionWindow> windows; ReadWindows(&(windows.get())); helper_.AssertSingleWindowWithSingleTab(windows.get(), 1); - EXPECT_TRUE(app_id == windows[0]->tabs[0]->app_extension_id); + EXPECT_TRUE(app_id == windows[0]->tabs[0]->extension_app_id); } // Explicitly set the pinned state to true and make sure we get back true. diff --git a/chrome/browser/sessions/session_types.h b/chrome/browser/sessions/session_types.h index b6f1dbc..475b99b 100644 --- a/chrome/browser/sessions/session_types.h +++ b/chrome/browser/sessions/session_types.h @@ -137,7 +137,7 @@ struct SessionTab { bool pinned; // If non-empty, this tab is an app tab and this is the id of the extension. - std::string app_extension_id; + std::string extension_app_id; std::vector<TabNavigation> navigations; diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc index 4dea440..af243d2 100644 --- a/chrome/browser/sessions/tab_restore_service.cc +++ b/chrome/browser/sessions/tab_restore_service.cc @@ -49,7 +49,7 @@ const size_t TabRestoreService::kMaxEntries = 10; // . When the user closes a tab a command of type // kCommandSelectedNavigationInTab is written identifying the tab and // the selected index, then a kCommandPinnedState command if the tab was -// pinned and kCommandSetAppExtensionID if the tab has an app id. This is +// pinned and kCommandSetExtensionAppID if the tab has an app id. This is // followed by any number of kCommandUpdateTabNavigation commands (1 per // navigation entry). // . When the user closes a window a kCommandSelectedNavigationInTab command @@ -62,7 +62,7 @@ static const SessionCommand::id_type kCommandRestoredEntry = 2; static const SessionCommand::id_type kCommandWindow = 3; static const SessionCommand::id_type kCommandSelectedNavigationInTab = 4; static const SessionCommand::id_type kCommandPinnedState = 5; -static const SessionCommand::id_type kCommandSetAppExtensionID = 6; +static const SessionCommand::id_type kCommandSetExtensionAppID = 6; // Number of entries (not commands) before we clobber the file and write // everything. @@ -274,7 +274,7 @@ void TabRestoreService::RestoreEntryById(Browser* browser, browser->ReplaceRestoredTab(tab->navigations, tab->current_navigation_index, tab->from_last_session, - tab->app_extension_id); + tab->extension_app_id); } else { // Use the tab's former browser and index, if available. Browser* tab_browser = NULL; @@ -297,7 +297,7 @@ void TabRestoreService::RestoreEntryById(Browser* browser, tab_index = tab_browser->tab_count(); tab_browser->AddRestoredTab(tab->navigations, tab_index, tab->current_navigation_index, - tab->app_extension_id, true, tab->pinned, + tab->extension_app_id, true, tab->pinned, tab->from_last_session); } } else if (entry->type == WINDOW) { @@ -309,7 +309,7 @@ void TabRestoreService::RestoreEntryById(Browser* browser, TabContents* restored_tab = browser->AddRestoredTab(tab.navigations, browser->tab_count(), tab.current_navigation_index, - tab.app_extension_id, + tab.extension_app_id, (static_cast<int>(tab_i) == window->selected_tab_index), tab.pinned, tab.from_last_session); @@ -414,9 +414,9 @@ void TabRestoreService::PopulateTab(Tab* tab, if (tab->current_navigation_index == -1 && entry_count > 0) tab->current_navigation_index = 0; - Extension* extension = controller->tab_contents()->app_extension(); + Extension* extension = controller->tab_contents()->extension_app(); if (extension) - tab->app_extension_id = extension->id(); + tab->extension_app_id = extension->id(); // Browser may be NULL during unit tests. if (browser) { @@ -520,10 +520,10 @@ void TabRestoreService::ScheduleCommandsForTab(const Tab& tab, ScheduleCommand(command); } - if (!tab.app_extension_id.empty()) { + if (!tab.extension_app_id.empty()) { ScheduleCommand( - CreateSetTabAppExtensionIDCommand(kCommandSetAppExtensionID, tab.id, - tab.app_extension_id)); + CreateSetTabExtensionAppIDCommand(kCommandSetExtensionAppID, tab.id, + tab.extension_app_id)); } // Then write the navigations. @@ -757,18 +757,18 @@ void TabRestoreService::CreateEntriesFromCommands( break; } - case kCommandSetAppExtensionID: { + case kCommandSetExtensionAppID: { if (!current_tab) { // Should be in a tab when we get this. return; } SessionID::id_type tab_id; - std::string app_extension_id; - if (!RestoreSetTabAppExtensionIDCommand(command, &tab_id, - &app_extension_id)) { + std::string extension_app_id; + if (!RestoreSetTabExtensionAppIDCommand(command, &tab_id, + &extension_app_id)) { return; } - current_tab->app_extension_id.swap(app_extension_id); + current_tab->extension_app_id.swap(extension_app_id); break; } @@ -884,7 +884,7 @@ bool TabRestoreService::ConvertSessionWindowToWindow( tab.navigations.swap(session_window->tabs[i]->navigations); tab.current_navigation_index = session_window->tabs[i]->current_navigation_index; - tab.app_extension_id = session_window->tabs[i]->app_extension_id; + tab.extension_app_id = session_window->tabs[i]->extension_app_id; tab.timestamp = Time(); } } diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h index 8aacc9c..229557f 100644 --- a/chrome/browser/sessions/tab_restore_service.h +++ b/chrome/browser/sessions/tab_restore_service.h @@ -102,7 +102,7 @@ class TabRestoreService : public BaseSessionService { bool pinned; // If non-empty gives the id of the extension for the tab. - std::string app_extension_id; + std::string extension_app_id; }; // Represents a previously open window. diff --git a/chrome/browser/sessions/tab_restore_service_unittest.cc b/chrome/browser/sessions/tab_restore_service_unittest.cc index 4af768d..e4e54cb 100644 --- a/chrome/browser/sessions/tab_restore_service_unittest.cc +++ b/chrome/browser/sessions/tab_restore_service_unittest.cc @@ -127,7 +127,7 @@ TEST_F(TabRestoreServiceTest, Basic) { ASSERT_EQ(TabRestoreService::TAB, entry->type); TabRestoreService::Tab* tab = static_cast<TabRestoreService::Tab*>(entry); EXPECT_FALSE(tab->pinned); - EXPECT_TRUE(tab->app_extension_id.empty()); + EXPECT_TRUE(tab->extension_app_id.empty()); ASSERT_EQ(3U, tab->navigations.size()); EXPECT_TRUE(url1_ == tab->navigations[0].virtual_url()); EXPECT_TRUE(url2_ == tab->navigations[1].virtual_url()); @@ -208,8 +208,8 @@ TEST_F(TabRestoreServiceTest, RestorePinnedAndApp) { ASSERT_EQ(TabRestoreService::TAB, entry->type); TabRestoreService::Tab* tab = static_cast<TabRestoreService::Tab*>(entry); tab->pinned = true; - const std::string app_extension_id("test"); - tab->app_extension_id = app_extension_id; + const std::string extension_app_id("test"); + tab->extension_app_id = extension_app_id; // Recreate the service and have it load the tabs. RecreateService(); @@ -227,7 +227,7 @@ TEST_F(TabRestoreServiceTest, RestorePinnedAndApp) { EXPECT_TRUE(url2_ == tab->navigations[1].virtual_url()); EXPECT_TRUE(url3_ == tab->navigations[2].virtual_url()); EXPECT_EQ(2, tab->current_navigation_index); - EXPECT_TRUE(app_extension_id == tab->app_extension_id); + EXPECT_TRUE(extension_app_id == tab->extension_app_id); } // Make sure we persist entries to disk that have post data. diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index c4cab4e..f4df639 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -276,8 +276,8 @@ TabContents::TabContents(Profile* profile, current_find_request_id_(find_request_id_counter_++), last_search_case_sensitive_(false), last_search_result_(), - app_extension_(NULL), - app_extension_for_current_page_(NULL), + extension_app_(NULL), + extension_app_for_current_page_(NULL), capturing_contents_(false), is_being_destroyed_(false), notify_disconnection_(false), @@ -498,11 +498,11 @@ RenderProcessHost* TabContents::GetRenderProcessHost() const { return render_manager_.current_host()->process(); } -void TabContents::SetAppExtension(Extension* extension) { +void TabContents::SetExtensionApp(Extension* extension) { DCHECK(!extension || extension->GetFullLaunchURL().is_valid()); - app_extension_ = extension; + extension_app_ = extension; - UpdateAppExtensionIcon(app_extension_); + UpdateExtensionAppIcon(extension_app_); NotificationService::current()->Notify( NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, @@ -510,20 +510,20 @@ void TabContents::SetAppExtension(Extension* extension) { NotificationService::NoDetails()); } -void TabContents::SetAppExtensionById(const std::string& app_extension_id) { - if (app_extension_id.empty()) +void TabContents::SetExtensionAppById(const std::string& extension_app_id) { + if (extension_app_id.empty()) return; ExtensionsService* extension_service = profile()->GetExtensionsService(); if (extension_service && extension_service->is_ready()) { Extension* extension = - extension_service->GetExtensionById(app_extension_id, false); + extension_service->GetExtensionById(extension_app_id, false); if (extension) - SetAppExtension(extension); + SetExtensionApp(extension); } } -SkBitmap* TabContents::GetAppExtensionIcon() { +SkBitmap* TabContents::GetExtensionAppIcon() { // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because // for those windows, we already have a big icon in the top-left outside any // tab. Having big tab icons too looks kinda redonk. @@ -531,10 +531,10 @@ SkBitmap* TabContents::GetAppExtensionIcon() { if (browser && browser->type() == Browser::TYPE_EXTENSION_APP) return NULL; - if (app_extension_icon_.empty()) + if (extension_app_icon_.empty()) return NULL; - return &app_extension_icon_; + return &extension_app_icon_; } const GURL& TabContents::GetURL() const { @@ -832,7 +832,7 @@ bool TabContents::NavigateToPendingEntry( // The url likely changed, see if there is an extension whose extent contains // the current page. - UpdateAppExtensionForCurrentPage(); + UpdateExtensionAppForCurrentPage(); return true; } @@ -854,9 +854,9 @@ TabContents* TabContents::Clone() { SiteInstance::CreateSiteInstance(profile()), MSG_ROUTING_NONE, this); tc->controller().CopyStateFrom(controller_); - tc->app_extension_ = app_extension_; - tc->app_extension_for_current_page_ = app_extension_for_current_page_; - tc->app_extension_icon_ = app_extension_icon_; + tc->extension_app_ = extension_app_; + tc->extension_app_for_current_page_ = extension_app_for_current_page_; + tc->extension_app_icon_ = extension_app_icon_; return tc; } @@ -1354,8 +1354,8 @@ TabContents* TabContents::CloneAndMakePhantom() { TabNavigation tab_nav; NavigationEntry* entry = controller().GetActiveEntry(); - if (app_extension_) - tab_nav.set_virtual_url(app_extension_->GetFullLaunchURL()); + if (extension_app_) + tab_nav.set_virtual_url(extension_app_->GetFullLaunchURL()); else if (entry) tab_nav.SetFromNavigationEntry(*entry); @@ -1364,10 +1364,10 @@ TabContents* TabContents::CloneAndMakePhantom() { TabContents* new_contents = new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL); - new_contents->SetAppExtension(app_extension_); + new_contents->SetExtensionApp(extension_app_); new_contents->controller().RestoreFromState(navigations, 0, false); - if (!app_extension_ && entry) + if (!extension_app_ && entry) new_contents->controller().GetActiveEntry()->favicon() = entry->favicon(); return new_contents; @@ -1614,7 +1614,7 @@ void TabContents::DidNavigateMainFramePostCommit( // The url likely changed, see if there is an extension whose extent contains // the current page. - UpdateAppExtensionForCurrentPage(); + UpdateExtensionAppForCurrentPage(); } void TabContents::DidNavigateAnyFramePostCommit( @@ -2967,10 +2967,10 @@ void TabContents::Observe(NotificationType type, } case NotificationType::EXTENSION_LOADED: { - if (!app_extension_ && !app_extension_for_current_page_ && + if (!extension_app_ && !extension_app_for_current_page_ && Source<Profile>(source).ptr() == profile()) { - UpdateAppExtensionForCurrentPage(); - if (app_extension_for_current_page_) + UpdateExtensionAppForCurrentPage(); + if (extension_app_for_current_page_) NotifyNavigationStateChanged(INVALIDATE_TAB); } break; @@ -2978,10 +2978,10 @@ void TabContents::Observe(NotificationType type, case NotificationType::EXTENSION_UNLOADED: case NotificationType::EXTENSION_UNLOADED_DISABLED: { - if (app_extension_for_current_page_ == + if (extension_app_for_current_page_ == Details<Extension>(details).ptr()) { - app_extension_for_current_page_ = NULL; - UpdateAppExtensionForCurrentPage(); + extension_app_for_current_page_ = NULL; + UpdateExtensionAppForCurrentPage(); NotifyNavigationStateChanged(INVALIDATE_TAB); } break; @@ -2992,19 +2992,19 @@ void TabContents::Observe(NotificationType type, } } -void TabContents::UpdateAppExtensionIcon(Extension* extension) { - app_extension_icon_.reset(); +void TabContents::UpdateExtensionAppIcon(Extension* extension) { + extension_app_icon_.reset(); if (extension) { - app_extension_image_loader_.reset(new ImageLoadingTracker(this)); - app_extension_image_loader_->LoadImage( + extension_app_image_loader_.reset(new ImageLoadingTracker(this)); + extension_app_image_loader_->LoadImage( extension, extension->GetIconPath(Extension::EXTENSION_ICON_SMALLISH), gfx::Size(Extension::EXTENSION_ICON_SMALLISH, Extension::EXTENSION_ICON_SMALLISH), ImageLoadingTracker::CACHE); } else { - app_extension_image_loader_.reset(NULL); + extension_app_image_loader_.reset(NULL); } } @@ -3018,26 +3018,26 @@ Extension* TabContents::GetExtensionContaining(const GURL& url) { extension : extensions_service->GetExtensionByWebExtent(url); } -void TabContents::UpdateAppExtensionForCurrentPage() { - if (app_extension_) { +void TabContents::UpdateExtensionAppForCurrentPage() { + if (extension_app_) { // Tab has an explicit app extension; nothing to do. return; } // Check the current extension before iterating through all extensions. - if (app_extension_for_current_page_ && - app_extension_for_current_page_->web_extent().ContainsURL(GetURL())) { + if (extension_app_for_current_page_ && + extension_app_for_current_page_->web_extent().ContainsURL(GetURL())) { return; } - app_extension_for_current_page_ = GetExtensionContaining(GetURL()); - UpdateAppExtensionIcon(app_extension_for_current_page_); + extension_app_for_current_page_ = GetExtensionContaining(GetURL()); + UpdateExtensionAppIcon(extension_app_for_current_page_); } void TabContents::OnImageLoaded(SkBitmap* image, ExtensionResource resource, int index) { if (image) { - app_extension_icon_ = *image; + extension_app_icon_ = *image; NotifyNavigationStateChanged(INVALIDATE_TAB); } } diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 9f870f5..3bca5e2 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -196,15 +196,15 @@ class TabContents : public PageNavigator, // NOTE: this should only be manipulated before the tab is added to a browser. // TODO(sky): resolve if this is the right way to identify an app tab. If it // is, than this should be passed in the constructor. - void SetAppExtension(Extension* extension); + void SetExtensionApp(Extension* extension); // Convenience for setting the app extension by id. This does nothing if - // |app_extension_id| is empty, or an extension can't be found given the + // |extension_app_id| is empty, or an extension can't be found given the // specified id. - void SetAppExtensionById(const std::string& app_extension_id); + void SetExtensionAppById(const std::string& extension_app_id); - Extension* app_extension() const { return app_extension_; } - bool is_app() const { return app_extension_ != NULL; } + Extension* extension_app() const { return extension_app_; } + bool is_app() const { return extension_app_ != NULL; } // If an app extension has been explicitly set for this TabContents its icon // is returned. If an app extension has not been set but there is an @@ -213,7 +213,7 @@ class TabContents : public PageNavigator, // // NOTE: the returned icon is larger than 16x16 (it's size is // Extension::EXTENSION_ICON_SMALLISH). - SkBitmap* GetAppExtensionIcon(); + SkBitmap* GetExtensionAppIcon(); // Tab navigation state ------------------------------------------------------ @@ -1021,10 +1021,10 @@ class TabContents : public PageNavigator, // Resets app_icon_ and if |extension| is non-null creates a new // ImageLoadingTracker to load the extension's image. - void UpdateAppExtensionIcon(Extension* extension); + void UpdateExtensionAppIcon(Extension* extension); // Called on every navigation to update app_icon_cache_entry_ as necessary. - void UpdateAppExtensionForCurrentPage(); + void UpdateExtensionAppForCurrentPage(); // ImageLoadingTracker::Observer. virtual void OnImageLoaded(SkBitmap* image, ExtensionResource resource, @@ -1188,17 +1188,17 @@ class TabContents : public PageNavigator, // If non-null this tab is an app tab and this is the extension the tab was // created for. - Extension* app_extension_; + Extension* extension_app_; - // If app_extension_ is NULL and there is an extension whose extent contains + // If extension_app_ is NULL and there is an extension whose extent contains // the current url, this is the extension. - Extension* app_extension_for_current_page_; + Extension* extension_app_for_current_page_; - // Icon for app_extension_ (if non-null) or extension_for_current_page_. - SkBitmap app_extension_icon_; + // Icon for extension_app_ (if non-null) or extension_for_current_page_. + SkBitmap extension_app_icon_; - // Used for loading app_extension_icon_. - scoped_ptr<ImageLoadingTracker> app_extension_image_loader_; + // Used for loading extension_app_icon_. + scoped_ptr<ImageLoadingTracker> extension_app_image_loader_; // Data for misc internal state ---------------------------------------------- diff --git a/chrome/browser/tabs/pinned_tab_codec.cc b/chrome/browser/tabs/pinned_tab_codec.cc index df096fc..3473343 100644 --- a/chrome/browser/tabs/pinned_tab_codec.cc +++ b/chrome/browser/tabs/pinned_tab_codec.cc @@ -43,7 +43,7 @@ static void EncodePinnedTab(TabStripModel* model, TabContents* tab_contents = model->GetTabContentsAt(index); if (model->IsAppTab(index)) { - Extension* extension = tab_contents->app_extension(); + Extension* extension = tab_contents->extension_app(); DCHECK(extension); value->SetString(kAppID, extension->id()); // For apps we use the launch url. We do this for two reasons: diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index f08e9c5..be154f6 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -765,7 +765,7 @@ void TabStripModel::Observe(NotificationType type, // Iterate backwards as we may remove items while iterating. for (int i = count() - 1; i >= 0; i--) { TabContents* contents = GetTabContentsAt(i); - if (contents->app_extension() == extension) { + if (contents->extension_app() == extension) { // The extension an app tab was created from has been nuked. Delete // the TabContents. Deleting a TabContents results in a notification // of type TAB_CONTENTS_DESTROYED; we do the necessary cleanup in @@ -937,11 +937,11 @@ bool TabStripModel::ShouldMakePhantomOnClose(int index) { if (!extension_service) return false; - Extension* app_extension = GetTabContentsAt(index)->app_extension(); - DCHECK(app_extension); + Extension* extension_app = GetTabContentsAt(index)->extension_app(); + DCHECK(extension_app); // Only allow the tab to be made phantom if the extension still exists. - return extension_service->GetExtensionById(app_extension->id(), + return extension_service->GetExtensionById(extension_app->id(), false) != NULL; } return false; diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 7ffaac4..faf3bd7 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -1500,12 +1500,12 @@ TEST_F(TabStripModelTest, Apps) { #elif defined(OS_POSIX) FilePath path(FILE_PATH_LITERAL("/foo")); #endif - Extension app_extension(path); - app_extension.launch_web_url_ = "http://www.google.com"; + Extension extension_app(path); + extension_app.launch_web_url_ = "http://www.google.com"; TabContents* contents1 = CreateTabContents(); - contents1->SetAppExtension(&app_extension); + contents1->SetExtensionApp(&extension_app); TabContents* contents2 = CreateTabContents(); - contents2->SetAppExtension(&app_extension); + contents2->SetExtensionApp(&extension_app); TabContents* contents3 = CreateTabContents(); SetID(contents1, 1); diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index bff941d..ec63fb2 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -327,7 +327,7 @@ void TabRenderer::UpdateData(TabContents* contents, data_.off_the_record = contents->profile()->IsOffTheRecord(); data_.crashed = contents->is_crashed(); data_.app = contents->is_app(); - SkBitmap* app_icon = contents->GetAppExtensionIcon(); + SkBitmap* app_icon = contents->GetExtensionAppIcon(); if (app_icon && data_.app) data_.favicon = *app_icon; else |